vscode-html-languageservice
Advanced tools
Comparing version 5.1.2 to 5.2.0
5.2.0 / 2024-03-22 | ||
================ | ||
* Added `HTMLFormatConfiguration.templating` now also take a list of template languages. | ||
5.1.0 / 2022-09-11 | ||
@@ -3,0 +8,0 @@ ================ |
// copied from js-beautify/js/lib/beautify-css.js | ||
// version: 1.14.11 | ||
// version: 1.15.1 | ||
/* AUTO-GENERATED. DO NOT MODIFY. */ | ||
@@ -573,6 +573,6 @@ /* | ||
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] | ||
// For now, 'auto' = all off for javascript, all on for html (and inline javascript). | ||
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular'] | ||
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css). | ||
// other values ignored | ||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); | ||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); | ||
} | ||
@@ -579,0 +579,0 @@ |
@@ -20,3 +20,3 @@ import { Position, Range, Location, MarkupContent, MarkupKind, MarkedString, DocumentUri, SelectionRange, WorkspaceEdit, CompletionList, CompletionItemKind, CompletionItem, CompletionItemTag, InsertTextMode, Command, SymbolInformation, DocumentSymbol, SymbolKind, Hover, TextEdit, InsertReplaceEdit, InsertTextFormat, DocumentHighlight, DocumentHighlightKind, DocumentLink, FoldingRange, FoldingRangeKind, SignatureHelp, Definition, Diagnostic, FormattingOptions, Color, ColorInformation, ColorPresentation } from 'vscode-languageserver-types'; | ||
indentScripts?: 'keep' | 'separate' | 'normal'; | ||
templating?: boolean; | ||
templating?: ('auto' | 'none' | 'angular' | 'django' | 'erb' | 'handlebars' | 'php' | 'smarty')[] | boolean; | ||
unformattedContentDelimiter?: string; | ||
@@ -23,0 +23,0 @@ } |
@@ -120,3 +120,6 @@ /*--------------------------------------------------------------------------------------------- | ||
} | ||
return ['none']; | ||
if (value === false || value === dflt || Array.isArray(value) === false) { | ||
return ['none']; | ||
} | ||
return value; | ||
} | ||
@@ -123,0 +126,0 @@ function computeIndentLevel(content, offset, options) { |
@@ -66,3 +66,3 @@ /*--------------------------------------------------------------------------------------------- | ||
} | ||
const target = validateAndCleanURI(workspaceUrl); | ||
const target = validateAndCleanURI(workspaceUrl, document); | ||
return { | ||
@@ -73,8 +73,14 @@ range: Range.create(document.positionAt(startOffset), document.positionAt(endOffset)), | ||
} | ||
function validateAndCleanURI(uriStr) { | ||
const _hash = '#'.charCodeAt(0); | ||
function validateAndCleanURI(uriStr, document) { | ||
try { | ||
const uri = Uri.parse(uriStr); | ||
if (uri.query) { | ||
return uri.with({ query: null }).toString(/* skipEncodig*/ true); | ||
let uri = Uri.parse(uriStr); | ||
if (uri.scheme === 'file' && uri.query) { | ||
// see https://github.com/microsoft/vscode/issues/194577 & https://github.com/microsoft/vscode/issues/206238 | ||
uri = uri.with({ query: null }); | ||
uriStr = uri.toString(/* skipEncodig*/ true); | ||
} | ||
if (uri.scheme === 'file' && uri.fragment && !(uriStr.startsWith(document.uri) && uriStr.charCodeAt(document.uri.length) === _hash)) { | ||
return uri.with({ fragment: null }).toString(/* skipEncodig*/ true); | ||
} | ||
return uriStr; | ||
@@ -146,2 +152,5 @@ } | ||
} | ||
else { | ||
link.target = document.uri; | ||
} | ||
} | ||
@@ -148,0 +157,0 @@ } |
// copied from js-beautify/js/lib/beautify-css.js | ||
// version: 1.14.11 | ||
// version: 1.15.1 | ||
/* AUTO-GENERATED. DO NOT MODIFY. */ | ||
@@ -576,6 +576,6 @@ /* | ||
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] | ||
// For now, 'auto' = all off for javascript, all on for html (and inline javascript). | ||
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular'] | ||
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css). | ||
// other values ignored | ||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); | ||
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); | ||
} | ||
@@ -582,0 +582,0 @@ |
@@ -20,3 +20,3 @@ import { Position, Range, Location, MarkupContent, MarkupKind, MarkedString, DocumentUri, SelectionRange, WorkspaceEdit, CompletionList, CompletionItemKind, CompletionItem, CompletionItemTag, InsertTextMode, Command, SymbolInformation, DocumentSymbol, SymbolKind, Hover, TextEdit, InsertReplaceEdit, InsertTextFormat, DocumentHighlight, DocumentHighlightKind, DocumentLink, FoldingRange, FoldingRangeKind, SignatureHelp, Definition, Diagnostic, FormattingOptions, Color, ColorInformation, ColorPresentation } from 'vscode-languageserver-types'; | ||
indentScripts?: 'keep' | 'separate' | 'normal'; | ||
templating?: boolean; | ||
templating?: ('auto' | 'none' | 'angular' | 'django' | 'erb' | 'handlebars' | 'php' | 'smarty')[] | boolean; | ||
unformattedContentDelimiter?: string; | ||
@@ -23,0 +23,0 @@ } |
@@ -133,3 +133,6 @@ /*--------------------------------------------------------------------------------------------- | ||
} | ||
return ['none']; | ||
if (value === false || value === dflt || Array.isArray(value) === false) { | ||
return ['none']; | ||
} | ||
return value; | ||
} | ||
@@ -136,0 +139,0 @@ function computeIndentLevel(content, offset, options) { |
@@ -78,3 +78,3 @@ /*--------------------------------------------------------------------------------------------- | ||
} | ||
const target = validateAndCleanURI(workspaceUrl); | ||
const target = validateAndCleanURI(workspaceUrl, document); | ||
return { | ||
@@ -85,8 +85,14 @@ range: htmlLanguageTypes_1.Range.create(document.positionAt(startOffset), document.positionAt(endOffset)), | ||
} | ||
function validateAndCleanURI(uriStr) { | ||
const _hash = '#'.charCodeAt(0); | ||
function validateAndCleanURI(uriStr, document) { | ||
try { | ||
const uri = vscode_uri_1.URI.parse(uriStr); | ||
if (uri.query) { | ||
return uri.with({ query: null }).toString(/* skipEncodig*/ true); | ||
let uri = vscode_uri_1.URI.parse(uriStr); | ||
if (uri.scheme === 'file' && uri.query) { | ||
// see https://github.com/microsoft/vscode/issues/194577 & https://github.com/microsoft/vscode/issues/206238 | ||
uri = uri.with({ query: null }); | ||
uriStr = uri.toString(/* skipEncodig*/ true); | ||
} | ||
if (uri.scheme === 'file' && uri.fragment && !(uriStr.startsWith(document.uri) && uriStr.charCodeAt(document.uri.length) === _hash)) { | ||
return uri.with({ fragment: null }).toString(/* skipEncodig*/ true); | ||
} | ||
return uriStr; | ||
@@ -158,2 +164,5 @@ } | ||
} | ||
else { | ||
link.target = document.uri; | ||
} | ||
} | ||
@@ -160,0 +169,0 @@ } |
{ | ||
"name": "vscode-html-languageservice", | ||
"version": "5.1.2", | ||
"version": "5.2.0", | ||
"description": "Language service for HTML", | ||
@@ -20,8 +20,8 @@ "main": "./lib/umd/htmlLanguageService.js", | ||
"@types/node": "16.x", | ||
"@typescript-eslint/eslint-plugin": "^6.19.1", | ||
"@typescript-eslint/parser": "^6.19.1", | ||
"@typescript-eslint/eslint-plugin": "^6.21.0", | ||
"@typescript-eslint/parser": "^6.21.0", | ||
"@vscode/web-custom-data": "^0.4.9", | ||
"eslint": "^8.56.0", | ||
"js-beautify": "^1.14.11", | ||
"mocha": "^10.2.0", | ||
"eslint": "^8.57.0", | ||
"js-beautify": "^1.15.1", | ||
"mocha": "^10.3.0", | ||
"rimraf": "^5.0.5", | ||
@@ -28,0 +28,0 @@ "typescript": "^5.3.3" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1585318
33230