File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 1
1
import * as vscode from "vscode" ;
2
2
import { DocumentContentProvider } from "./DocumentContentProvider" ;
3
- import { ObjectScriptClassSymbolProvider } from "./ObjectScriptClassSymbolProvider" ;
4
3
5
4
interface StudioLink {
6
5
uri : vscode . Uri ;
@@ -58,14 +57,11 @@ export class DocumentLinkProvider implements vscode.DocumentLinkProvider {
58
57
59
58
// add the offset of the method if it is a class
60
59
if ( link . methodname ) {
61
- console . log ( "running class code" ) ;
62
- const symbols = await new ObjectScriptClassSymbolProvider ( ) . provideDocumentSymbols ( editor . document , token ) ;
63
- const methods = symbols [ 0 ] . children ;
64
- const matchingMethod = methods . find (
65
- ( method ) => ( method . detail === "ClassMethod" || method . detail === "Method " ) && method . name === link . methodname
60
+ const symbols = await vscode . commands . executeCommand ( "vscode.executeDocumentSymbolProvider" , link . uri ) ;
61
+ const method = symbols [ 0 ] . children . find (
62
+ ( info ) => ( info . detail === "ClassMethod" || info . detail === "Method" ) && info . name === link . methodname
66
63
) ;
67
- const methodLine = matchingMethod . range . start . line ;
68
- offset += methodLine + 1 ;
64
+ offset += method . location . range . start . line + 1 ;
69
65
}
70
66
71
67
// move the cursor
You can’t perform that action at this time.
0 commit comments