From a4e47390f46d3b1c5a937090da90c01f699fe5ee Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Wed, 3 Jul 2024 12:28:50 +0200 Subject: [PATCH 1/2] Support to read 0.5.0 dumps --- language-service/SECURITY.md | 41 +++++++++++++++++++++++++++++++ language-service/package.json | 4 ++- language-service/src/jsonStore.ts | 12 ++++++--- 3 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 language-service/SECURITY.md diff --git a/language-service/SECURITY.md b/language-service/SECURITY.md new file mode 100644 index 0000000..1f9d3d4 --- /dev/null +++ b/language-service/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). + + \ No newline at end of file diff --git a/language-service/package.json b/language-service/package.json index 9880f1e..7c7a017 100644 --- a/language-service/package.json +++ b/language-service/package.json @@ -1,7 +1,7 @@ { "name": "@vscode/lsif-language-service", "description": "LSIF based language services", - "version": "0.1.0-pre.1", + "version": "0.1.0-pre.2", "author": "Microsoft Corporation", "license": "MIT", "repository": { @@ -14,6 +14,8 @@ "engines": { "node": ">=20.9.0" }, + "main": "./lib/api.js", + "typings": "./lib/api.d.ts", "exports": { ".": { "types": "./lib/api.d.ts", diff --git a/language-service/src/jsonStore.ts b/language-service/src/jsonStore.ts index 52e0fb6..f97e1e0 100644 --- a/language-service/src/jsonStore.ts +++ b/language-service/src/jsonStore.ts @@ -13,7 +13,7 @@ import { Id, Vertex, Project, Document, Range, DiagnosticResult, DocumentSymbolResult, FoldingRangeResult, DocumentLinkResult, DefinitionResult, TypeDefinitionResult, HoverResult, ReferenceResult, ImplementationResult, Edge, RangeBasedDocumentSymbol, DeclarationResult, ElementTypes, VertexLabels, EdgeLabels, ItemEdgeProperties, EventScope, EventKind, ProjectEvent, Moniker as PMoniker, MonikerKind, - types + types, type MetaData } from '@vscode/lsif-protocol'; import { DocumentInfo } from './files'; @@ -165,10 +165,10 @@ export class JsonStore extends Database { reject(new Error(`No valid semantic version string. The version is: ${this.version}`)); return; } - const range: SemVer.Range = new SemVer.Range('>0.5.99 <=0.6.0-next.7'); + const range: SemVer.Range = new SemVer.Range('>=0.5.0 <=0.6.0-next.7'); range.includePrerelease = true; if (!SemVer.satisfies(semVer, range)) { - reject(new Error(`Requires version range >0.5.99 <=0.6.0-next.7 but received: ${this.version}`)); + reject(new Error(`Requires version range >=0.5.0 <=0.6.0-next.7 but received: ${this.version}`)); return; } } @@ -187,10 +187,16 @@ export class JsonStore extends Database { } private processVertex(vertex: Vertex): void { + interface LegacyMetaData extends MetaData { + projectRoot?: string; + } this.vertices.all.set(vertex.id, vertex); switch(vertex.label) { case VertexLabels.metaData: this.version = vertex.version; + if (this.workspaceRoot === undefined && (vertex as LegacyMetaData).projectRoot !== undefined) { + this.workspaceRoot = URI.parse((vertex as LegacyMetaData).projectRoot!); + } break; case VertexLabels.source: this.workspaceRoot = URI.parse(vertex.workspaceRoot); From 38ca51cce92fbd4a237e5a6065d98943ce1b2654 Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Wed, 3 Jul 2024 12:29:18 +0200 Subject: [PATCH 2/2] Update version --- language-service/package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/language-service/package-lock.json b/language-service/package-lock.json index 36fae7d..1c0a95c 100644 --- a/language-service/package-lock.json +++ b/language-service/package-lock.json @@ -1,12 +1,12 @@ { "name": "@vscode/lsif-language-service", - "version": "0.1.0-pre.1", + "version": "0.1.0-pre.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@vscode/lsif-language-service", - "version": "0.1.0-pre.1", + "version": "0.1.0-pre.2", "license": "MIT", "dependencies": { "@vscode/lsif-protocol": "0.6.0-next.8",