mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Fully add inline modules to module tree
This commit is contained in:
parent
44d8919384
commit
6bbcfca7ae
9 changed files with 99 additions and 47 deletions
|
@ -6,10 +6,6 @@ import {
|
|||
SourceChange
|
||||
} from './apply_source_change';
|
||||
|
||||
interface OnEnterParams {
|
||||
textDocument: lc.TextDocumentIdentifier;
|
||||
position: lc.Position;
|
||||
}
|
||||
|
||||
export async function handle(event: { text: string }): Promise<boolean> {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
|
@ -20,7 +16,7 @@ export async function handle(event: { text: string }): Promise<boolean> {
|
|||
) {
|
||||
return false;
|
||||
}
|
||||
const request: OnEnterParams = {
|
||||
const request: lc.TextDocumentPositionParams = {
|
||||
textDocument: { uri: editor.document.uri.toString() },
|
||||
position: Server.client.code2ProtocolConverter.asPosition(
|
||||
editor.selection.active
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as vscode from 'vscode';
|
||||
|
||||
import { Location, TextDocumentIdentifier } from 'vscode-languageclient';
|
||||
import * as lc from 'vscode-languageclient';
|
||||
import { Server } from '../server';
|
||||
|
||||
export async function handle() {
|
||||
|
@ -8,10 +8,13 @@ export async function handle() {
|
|||
if (editor == null || editor.document.languageId !== 'rust') {
|
||||
return;
|
||||
}
|
||||
const request: TextDocumentIdentifier = {
|
||||
uri: editor.document.uri.toString()
|
||||
const request: lc.TextDocumentPositionParams = {
|
||||
textDocument: { uri: editor.document.uri.toString() },
|
||||
position: Server.client.code2ProtocolConverter.asPosition(
|
||||
editor.selection.active
|
||||
)
|
||||
};
|
||||
const response = await Server.client.sendRequest<Location[]>(
|
||||
const response = await Server.client.sendRequest<lc.Location[]>(
|
||||
'm/parentModule',
|
||||
request
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue