@imc-trading/svlangserver
Version:
A language server for systemverilog
99 lines (97 loc) • 4.91 kB
TypeScript
import { SymbolInformation } from 'vscode-languageserver/node';
import { Position } from 'vscode-languageserver-types';
import { TextDocument } from 'vscode-languageserver-textdocument';
import { SystemVerilogSymbol } from './svsymbol';
import { SystemVerilogParser } from './svparser';
import { GrammarToken } from './grammar_engine';
export declare class SystemVerilogIndexer {
private _rootPath;
private _clientDir;
private _srcFiles;
private _mustSrcFiles;
private _libFiles;
private _preprocCache;
private _indexedFilesInfo;
private _pkgToFiles;
private _moduleToFiles;
private _interfaceToFiles;
private _fileToContainers;
private _lastSavedFilesInfo;
private _indexProgress;
private _cacheLoadingDone;
private _indexIsSaveable;
private _completionGrammarEngine;
private _filesCompletionInfo;
private _userDefines;
private _optionsFileContent;
NUM_FILES: number;
mostRecentSymbols: SymbolInformation[];
constructor(aRootPath?: string);
setRoot(aRootPath?: string): void;
setClientDir(aClientDir?: string): void;
getIndexFile(): string;
getLinterOptionsFile(): string;
setDefines(defines: string[]): void;
private _indexGlob;
setLibraries(libraries: string[], excludes: string[]): void;
_waitForHalt(retryCount?: number): Promise<void>;
index(includes: string[], mustIncludes: string[], excludes: string[]): void;
private _loadCachedIndex;
private _setHeaderSymbols;
private _buildIndex;
private _getContainers;
private _updateFileInfo;
private _updatePkgFilesInfo;
private _incDepsRank;
private _generateVerilatorOptionsFile;
getOptionsFileContent(): string[];
fileHasPkg(file: string): boolean;
isMustSrcFile(file: string): boolean;
processDocumentChanges(document: TextDocument): void;
indexOpenDocument(document: TextDocument, retryCount?: number): void;
updateFileInfoOnSave(document: TextDocument): void;
private _incrementalUpdateFileInfo;
private _indexToCache;
saveIndex(): Promise<void>;
saveIndexOnExit(): void;
getDocumentSystemVerilogSymbols(documentUri: string, strict?: Boolean): SystemVerilogSymbol[];
getDocumentSymbols(document: TextDocument, retryCount?: number): Promise<SymbolInformation[]>;
private _getWorkspaceSymbols;
getWorkspaceSystemVerilogSymbols(query: string): Promise<SystemVerilogSymbol[]>;
getWorkspaceSymbols(query: string): Promise<SymbolInformation[]>;
/**
Updates `mostRecentSymbols` with the most recently used symbols
When `mostRecentSymbols` is undefined, add the top `this.NUM_FILES` symbol from `this._indexedFilesInfo`
When `mostRecentSymbols` is defined, add the symbols in `recentSymbols` one by one to the top of the array
@param recentSymbols the recent symbols
*/
updateMostRecentSymbols(recentSymbols: SymbolInformation[]): void;
getSystemVerilogCompletionTokens(uri: string): GrammarToken[];
private leftExtendHierToken;
getSystemVerilogCompletionTokenNumber(document: TextDocument, line: number, character: number): [number, number];
getPackages(): string[];
getInstFilePath(instType: string): string;
private _getContainerSymbols;
getPackageSymbols(pkg: string): SystemVerilogSymbol[];
getInstParams(instType: string, firstMatch?: Boolean): SystemVerilogSymbol[];
getInstPorts(instType: string, firstMatch?: Boolean): SystemVerilogSymbol[];
private _getContainerSymbol;
getContainerSymbol(cntnrName: string): SystemVerilogSymbol;
getPackageSymbol(pkgName: string): [string, SystemVerilogSymbol];
private _findPackageSymbol;
private _findSymbol;
getContainerInfo(uri: string, containerName: string): [string, SystemVerilogSymbol, SystemVerilogParser.SystemVerilogContainerSymbolsInfo];
findSymbol(uri: string, symbolName: string): [string, SystemVerilogSymbol];
findScopedSymbol(uri: string, symbolName: string, position: Position): [string, SystemVerilogSymbol];
getMacros(fileUri: string, macroName?: string): [string, SystemVerilogSymbol[]][];
private _getActualDataType;
getHierParts(symbolPath: string, idTokens?: GrammarToken[], length?: number): string[];
getSymbolTypeContainerInfo(fileUri: string, symbol: SystemVerilogSymbol, containerSymbolsInfo?: SystemVerilogParser.SystemVerilogContainerSymbolsInfo): [string, SystemVerilogSymbol, SystemVerilogParser.SystemVerilogContainerSymbolsInfo];
getHierarchicalSymbol(fileUri: string, symbolParts: string[]): [string, SystemVerilogSymbol];
private _resolveImportsIntoSymbolNames;
getFileImports(fileUri: string): [string, string[]][];
findUserDefine(defText: string): number;
getUserDefine(defNum: number): string;
getIncFilePathAndSymbol(filePath: string): [string, SystemVerilogSymbol];
getHier(cntnrName: string): {};
}