This repository was archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 657
fix(rome_lsp): rename off by default for vscode #3473
Merged
+121
−53
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1201f11
rename off by default for vscode
xunilrj 033c9c2
removing unwrap
xunilrj f8c57be
small refactor
xunilrj f2a5378
fmt and clippy issues
xunilrj 77384ce
dynamic configuration for renaming
xunilrj 5dd3c41
fmt and clippy issues
xunilrj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,6 +167,30 @@ impl LanguageServer for LSPServer { | |
Ok(()) | ||
} | ||
|
||
#[tracing::instrument(level = "trace", skip(self))] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just sorted these fns. |
||
async fn did_change_configuration(&self, params: DidChangeConfigurationParams) { | ||
let _ = params; | ||
self.session.fetch_client_configuration().await; | ||
} | ||
|
||
async fn did_open(&self, params: DidOpenTextDocumentParams) { | ||
handlers::text_document::did_open(&self.session, params) | ||
.await | ||
.ok(); | ||
} | ||
|
||
async fn did_change(&self, params: DidChangeTextDocumentParams) { | ||
handlers::text_document::did_change(&self.session, params) | ||
.await | ||
.ok(); | ||
} | ||
|
||
async fn did_close(&self, params: DidCloseTextDocumentParams) { | ||
handlers::text_document::did_close(&self.session, params) | ||
.await | ||
.ok(); | ||
} | ||
|
||
async fn code_action(&self, params: CodeActionParams) -> LspResult<Option<CodeActionResponse>> { | ||
handlers::analysis::code_actions(&self.session, params).map_err(into_lsp_error) | ||
} | ||
|
@@ -192,32 +216,20 @@ impl LanguageServer for LSPServer { | |
handlers::formatting::format_on_type(&self.session, params).map_err(into_lsp_error) | ||
} | ||
|
||
#[tracing::instrument(level = "trace", skip(self))] | ||
async fn did_change_configuration(&self, params: DidChangeConfigurationParams) { | ||
let _ = params; | ||
self.session.fetch_client_configuration().await; | ||
} | ||
|
||
async fn did_open(&self, params: DidOpenTextDocumentParams) { | ||
handlers::text_document::did_open(&self.session, params) | ||
.await | ||
.ok(); | ||
} | ||
|
||
async fn did_change(&self, params: DidChangeTextDocumentParams) { | ||
handlers::text_document::did_change(&self.session, params) | ||
.await | ||
.ok(); | ||
} | ||
|
||
async fn did_close(&self, params: DidCloseTextDocumentParams) { | ||
handlers::text_document::did_close(&self.session, params) | ||
.await | ||
.ok(); | ||
} | ||
|
||
async fn rename(&self, params: RenameParams) -> LspResult<Option<WorkspaceEdit>> { | ||
handlers::rename::rename(&self.session, params).map_err(into_lsp_error) | ||
let rename_enabled = self | ||
.session | ||
.config | ||
.read() | ||
.ok() | ||
.and_then(|config| config.settings.rename) | ||
.unwrap_or(false); | ||
|
||
if rename_enabled { | ||
handlers::rename::rename(&self.session, params).map_err(into_lsp_error) | ||
} else { | ||
Ok(None) | ||
xunilrj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rome_lsp
was not compiling