How to use vscode - 10 common examples

To help you get started, we’ve selected a few vscode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DonJayamanne / pythonVSCode / src / client / common / configSettings.ts View on Github external
constructor(
        workspaceFolder: Resource,
        private readonly interpreterAutoSelectionService: IInterpreterAutoSeletionProxyService,
        workspace?: IWorkspaceService) {
        this.workspace = workspace || new WorkspaceService();
        this.workspaceRoot = workspaceFolder ? workspaceFolder : Uri.file(__dirname);
        this.initialize();
    }
    // tslint:disable-next-line:function-name
github jan-dolejsi / vscode-pddl / client / src / extension.ts View on Github external
export async function activate(context: ExtensionContext) {

	let extensionInfo = new ExtensionInfo();

	// initialize the instrumentation wrapper
	await initialize(extensionInfo.getId(), extensionInfo.getVersion(), KEY);

	try {
		// activate the extension, but send instrumentation data
		await instrumentOperation("activation", activateWithTelemetry)(context);
	}
	catch (ex) {
		// sadly, the next line never gets triggered, even if the activateWithTelemetry fails
		window.showErrorMessage("There was an error starting the PDDL extension: " + ex.message);
	}
}
github microsoft / vscode-cpptools / Extension / src / LanguageServer / colorization.ts View on Github external
private textToRange(text: string, startPosition: vscode.Position): vscode.Range {
        let parts: string[] = text.split("\n");
        let addedLines: number = parts.length - 1;
        let newStartLine: number = startPosition.line;
        let newStartCharacter: number = startPosition.character;
        let newEndLine: number = newStartLine + addedLines;
        let newEndCharacter: number = parts[parts.length - 1].length;
        if (newStartLine === newEndLine) {
            newEndCharacter += newStartCharacter;
        }
        return new vscode.Range(newStartLine, newStartCharacter, newEndLine, newEndCharacter);
    }
github JohnstonCode / svn-scm / src / model.ts View on Github external
constructor(private svn: Svn) {
    const config = workspace.getConfiguration("svn");
    this.enabled = config.get("enabled") === true;

    svn
      .isSvnAvailable()
      .then(() => {
        if (this.enabled && svn.isSvnAvailable()) {
          this.init();
        } else {
          this.disable();
        }
      })
      .catch(() => {});
  }
github microsoft / vscode-service-fabric-reliable-services / src / yo / index.ts View on Github external
function openFolder(folderPath: string) {
	let uri = Uri.file(folderPath);
	commands.executeCommand('vscode.openFolder', uri);
}
github wx-minapp / minapp-vscode / src / plugin / lib / ScriptFile.ts View on Github external
.forEach(mat => {
      const property = mat[2] || mat[3] || prop
      let pos = getPositionFromIndex(content, mat.index + mat[0].indexOf(property))
      let endPos = new Position(pos.line, pos.character + property.length)
      locs.push({
        loc: new Location(Uri.file(file), new Range(pos, endPos)),
        name: property,
        detail: mat[1] || mat[0],
      })
    })
  return locs
github JohnstonCode / svn-scm / src / repository.ts View on Github external
show(filePath: string) {
    const config = workspace.getConfiguration("files", Uri.file(filePath));
    const encoding = config.get("encoding");

    return this.repository.show(filePath, { encoding });
  }
}
github microsoft / vscode / extensions / typescript-language-features / src / features / completions.ts View on Github external
private getDocumentation(
		detail: Proto.CompletionEntryDetails,
		item: MyCompletionItem
	): vscode.MarkdownString | undefined {
		const documentation = new vscode.MarkdownString();
		if (detail.source) {
			const importPath = `'${Previewer.plain(detail.source)}'`;
			const autoImportLabel = localize('autoImportLabel', 'Auto import from {0}', importPath);
			item.detail = `${autoImportLabel}\n${item.detail}`;
		}
		Previewer.addMarkdownDocumentation(documentation, detail.documentation, detail.tags);

		return documentation.value.length ? documentation : undefined;
	}
github castwide / vscode-solargraph / src / RubyCompletionItemProvider.ts View on Github external
private formatDocumentation(doc: string): vscode.MarkdownString {
		var md = new vscode.MarkdownString(doc);
		md.isTrusted = true;
		return md;		
	}
}
github KamasamaK / vscode-cfml / src / features / completionItemProvider.ts View on Github external
function createNewProposal(name: string, kind: CompletionItemKind, entry?: CompletionEntry, sortPrefix?: string): CompletionItem {
  const proposal: CompletionItem = new CompletionItem(name, kind);
  if (entry) {
    if (entry.detail) {
      proposal.detail = entry.detail;
    }
    if (entry.description) {
      proposal.documentation = textToMarkdownString(entry.description);
    }
  }
  if (sortPrefix) {
    proposal.sortText = `${sortPrefix}${name}`;
  }

  return proposal;
}

vscode

## ⚠️ Deprecated, use @types/vscode and vscode-test instead ⚠️

MIT
Latest version published 5 years ago

Package Health Score

47 / 100
Full package analysis