Skip to content
Snippets Groups Projects

Add TitanTypeHierarchyProvider (issue #12)

Merged Csilla Farkas requested to merge csilla/titan.vs-code-extension:typeHierarchy into main
4 files
+ 59
13
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -10,7 +10,7 @@
*/
import { LanguageClient, ResponseError, TextDocumentIdentifier } from "vscode-languageclient/node";
import { window, Position, Uri} from "vscode";
import { window, Position, Uri, TypeHierarchyItem} from "vscode";
import client from "./titanClient";
import { docCommentViewProvider } from "../view/DocCommentViewProvider";
import * as md from 'markdown-it';
@@ -22,7 +22,9 @@ class ClientManager {
exclude: 'titan/setExcludedState',
openTpd: 'titan/openTpd',
generateDocComment: 'titan/generateDocumentComment',
prepareTypeHierarchy: 'textDocument/prepareTypeHierarchy'
prepareTypeHierarchy: 'textDocument/prepareTypeHierarchy',
supertypesTypeHierarchy: 'typeHierarchy/supertypes',
subtypesTypeHierarchy: 'typeHierarchy/subtypes'
};
constructor(private _client: LanguageClient) {};
@@ -65,6 +67,16 @@ class ClientManager {
const typeHierarchyItems = await this._client.sendRequest(this._methods.prepareTypeHierarchy, requestParams);
return typeHierarchyItems;
}
public async resolveSupertypes(requestParams: {item: TypeHierarchyItem }) {
const supertypesResult = await this._client.sendRequest(this._methods.supertypesTypeHierarchy, requestParams);
return supertypesResult;
}
public async resolveSubtypes(requestParams: {item: TypeHierarchyItem}) {
const subtypeResult = await this._client.sendRequest(this._methods.subtypesTypeHierarchy, requestParams);
return subtypeResult;
}
}
export const clientManager = new ClientManager(client);
\ No newline at end of file
Loading