當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript vscode-languageserver.RemoteConsole類代碼示例

本文整理匯總了TypeScript中vscode-languageserver.RemoteConsole的典型用法代碼示例。如果您正苦於以下問題:TypeScript RemoteConsole類的具體用法?TypeScript RemoteConsole怎麽用?TypeScript RemoteConsole使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了RemoteConsole類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: nodeMcuSignatureHelpHandler

export function nodeMcuSignatureHelpHandler(remoteConsole: RemoteConsole, document: TextDocument, textDocumentPosition: TextDocumentPositionParams): SignatureHelp {
    remoteConsole.log("Server nodeMcuSignatureHelpHandler entered");

    let text = document.getText();
    let lineText = text.split(/\r?\n/g)[textDocumentPosition.position.line];

    let analyzeResult = analyze(lineText, textDocumentPosition.position);

    remoteConsole.log("Server nodeMcuSignatureHelpHandler word: " + JSON.stringify(analyzeResult));

    if (analyzeResult.inSignatureDefinition &&  analyzeResult.signatureName && analyzeResult.moduleName && api[analyzeResult.moduleName]) {
        let currentApi: CompletionItem[] = api[analyzeResult.moduleName];

        let filtered = currentApi.filter(function (value: CompletionItem, index: number, array: CompletionItem[]) {
            return value.label == analyzeResult.signatureName;
        });

        if (filtered.length > 0) {

            let signatureInfo: SignatureInformation = {
                label: filtered[0].detail,
                documentation: filtered[0].documentation
            };

            let result: SignatureHelp = {
                signatures: [signatureInfo],
            };

            return result;
        }
    }

    return null;
}
開發者ID:fduman,項目名稱:vscode-nodemcu,代碼行數:34,代碼來源:nodeMcuSignatureHelpHandler.ts

示例2: nodeMcuCompletionHandler

export function nodeMcuCompletionHandler(remoteConsole: RemoteConsole, document: TextDocument, textDocumentPosition: TextDocumentPositionParams): CompletionItem[] {
    remoteConsole.log("Server nodeMcuCompletionHandler entered");

    let text = document.getText();
    let lineText = text.split(/\r?\n/g)[textDocumentPosition.position.line];

    let analyzeResult = analyze(lineText, textDocumentPosition.position);

    remoteConsole.log("Server nodeMcuCompletionHandler analyze: " + JSON.stringify(analyzeResult));

    if (analyzeResult.moduleName == null || !api[analyzeResult.moduleName]) {
        return modules.concat(lua);
    }
    else if (api[analyzeResult.moduleName]) {
        return api[analyzeResult.moduleName];
    }

    return null;
}
開發者ID:fduman,項目名稱:vscode-nodemcu,代碼行數:19,代碼來源:nodeMcuCompletionHandler.ts

示例3: error

 public error(message: string): void {
     if (this.level >= LogLevel.error) {
         this.logger.error(message);
         this.window.showErrorMessage(message);
     }
 }
開發者ID:bravomikekilo,項目名稱:vscode-ghc-mod,代碼行數:6,代碼來源:remoteConnectionAdapter.ts

示例4: warn

 public warn(message: string): void {
     if (this.level >= LogLevel.warn) {
         this.logger.warn(message);
     }
 }
開發者ID:bravomikekilo,項目名稱:vscode-ghc-mod,代碼行數:5,代碼來源:remoteConnectionAdapter.ts

示例5: info

 public info(message: string): void {
     if (this.level >= LogLevel.info) {
         this.logger.info(message);
     }
 }
開發者ID:bravomikekilo,項目名稱:vscode-ghc-mod,代碼行數:5,代碼來源:remoteConnectionAdapter.ts

示例6: log

 public log(message: string): void {
     if (this.level >= LogLevel.log) {
         this.logger.log(message);
     }
 }
開發者ID:bravomikekilo,項目名稱:vscode-ghc-mod,代碼行數:5,代碼來源:remoteConnectionAdapter.ts


注:本文中的vscode-languageserver.RemoteConsole類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。