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 11import * as vscode from "vscode" ;
22import { DocumentContentProvider } from "./DocumentContentProvider" ;
3- import { ObjectScriptClassSymbolProvider } from "./ObjectScriptClassSymbolProvider" ;
43
54interface StudioLink {
65 uri : vscode . Uri ;
@@ -58,14 +57,11 @@ export class DocumentLinkProvider implements vscode.DocumentLinkProvider {
5857
5958 // add the offset of the method if it is a class
6059 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
6663 ) ;
67- const methodLine = matchingMethod . range . start . line ;
68- offset += methodLine + 1 ;
64+ offset += method . location . range . start . line + 1 ;
6965 }
7066
7167 // move the cursor
You can’t perform that action at this time.
0 commit comments