mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-16 07:15:24 +00:00
Allow locate parent module action in cargo toml
This commit is contained in:
parent
60c5449120
commit
39044fe39c
3 changed files with 83 additions and 8 deletions
|
@ -104,6 +104,11 @@ export function isRustDocument(document: vscode.TextDocument): document is RustD
|
|||
return document.languageId === 'rust' && document.uri.scheme === 'file';
|
||||
}
|
||||
|
||||
export function isCargoTomlDocument(document: vscode.TextDocument): document is RustDocument {
|
||||
// ideally `document.languageId` should be 'toml' but user maybe not have toml extension installed
|
||||
return document.uri.scheme === 'file' && document.fileName.endsWith('Cargo.toml');
|
||||
}
|
||||
|
||||
export function isRustEditor(editor: vscode.TextEditor): editor is RustEditor {
|
||||
return isRustDocument(editor.document);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue