Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@volar/language-service

Package Overview
Dependencies
Maintainers
1
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volar/language-service - npm Package Compare versions

Comparing version 2.3.0-alpha.3 to 2.3.0-alpha.4

56

lib/utils/transform.js

@@ -13,6 +13,7 @@ "use strict";

}
const embeddedRange = target.fragment.match(/^L(\d+)(,(\d+))?(-L(\d+)(,(\d+))?)?$/);
const sourceScript = context.language.scripts.get(decoded[0]);
const virtualCode = sourceScript?.generated?.embeddedCodes.get(decoded[1]);
target = decoded[0];
const sourceScript = context.language.scripts.get(target);
const virtualCode = sourceScript?.generated?.embeddedCodes.get(decoded[1]);
if (virtualCode) {
if (embeddedRange && virtualCode) {
for (const map of context.documents.getMaps(virtualCode)) {

@@ -22,31 +23,26 @@ if (!map.map.mappings.some(mapping => (0, language_core_1.isDocumentLinkEnabled)(mapping.data))) {

}
target = vscode_uri_1.URI.parse(map.sourceDocument.uri);
const hash = target.fragment;
const range = hash.match(/^L(\d+)(,(\d+))?(-L(\d+)(,(\d+))?)?$/);
if (range) {
const startLine = Number(range[1]) - 1;
const startCharacter = Number(range[3] ?? 1) - 1;
if (range[5] !== undefined) {
const endLine = Number(range[5]) - 1;
const endCharacter = Number(range[7] ?? 1) - 1;
const sourceRange = map.getSourceRange({
start: { line: startLine, character: startCharacter },
end: { line: endLine, character: endCharacter },
const startLine = Number(embeddedRange[1]) - 1;
const startCharacter = Number(embeddedRange[3] ?? 1) - 1;
if (embeddedRange[5] !== undefined) {
const endLine = Number(embeddedRange[5]) - 1;
const endCharacter = Number(embeddedRange[7] ?? 1) - 1;
const sourceRange = map.getSourceRange({
start: { line: startLine, character: startCharacter },
end: { line: endLine, character: endCharacter },
});
if (sourceRange) {
target = target.with({
fragment: 'L' + (sourceRange.start.line + 1) + ',' + (sourceRange.start.character + 1)
+ '-L' + (sourceRange.end.line + 1) + ',' + (sourceRange.end.character + 1),
});
if (sourceRange) {
target = target.with({
fragment: 'L' + (sourceRange.start.line + 1) + ',' + (sourceRange.start.character + 1)
+ '-L' + (sourceRange.end.line + 1) + ',' + (sourceRange.end.character + 1),
});
break;
}
break;
}
else {
const sourcePos = map.getSourcePosition({ line: startLine, character: startCharacter });
if (sourcePos) {
target = target.with({
fragment: 'L' + (sourcePos.line + 1) + ',' + (sourcePos.character + 1),
});
break;
}
}
else {
const sourcePos = map.getSourcePosition({ line: startLine, character: startCharacter });
if (sourcePos) {
target = target.with({
fragment: 'L' + (sourcePos.line + 1) + ',' + (sourcePos.character + 1),
});
break;
}

@@ -53,0 +49,0 @@ }

{
"name": "@volar/language-service",
"version": "2.3.0-alpha.3",
"version": "2.3.0-alpha.4",
"license": "MIT",

@@ -15,3 +15,3 @@ "files": [

"dependencies": {
"@volar/language-core": "2.3.0-alpha.3",
"@volar/language-core": "2.3.0-alpha.4",
"vscode-languageserver-protocol": "^3.17.5",

@@ -21,3 +21,3 @@ "vscode-languageserver-textdocument": "^1.0.11",

},
"gitHead": "d322a122012dc339a3ac5139220e91649d508522"
"gitHead": "8ab3ce02b06a410e9321eea3e9f23d36f97fedda"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc