mirror of
https://github.com/Microsoft/vscode
synced 2024-10-05 19:02:54 +00:00
The feature page of vscode.html plugin is empty (#214455)
This commit is contained in:
parent
86f1484693
commit
43c8fe13e0
|
@ -41,7 +41,7 @@ export interface IDebugger {
|
|||
}
|
||||
|
||||
export interface IGrammar {
|
||||
language: string;
|
||||
language?: string;
|
||||
}
|
||||
|
||||
export interface IJSONValidation {
|
||||
|
|
|
@ -23,6 +23,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
|||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { index } from 'vs/base/common/arrays';
|
||||
import { MarkdownString } from 'vs/base/common/htmlContent';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
|
||||
export interface IRawLanguageExtensionPoint {
|
||||
id: string;
|
||||
|
@ -147,6 +148,10 @@ class LanguageTableRenderer extends Disposable implements IExtensionFeatureTable
|
|||
|
||||
const grammars = contributes?.grammars || [];
|
||||
grammars.forEach(grammar => {
|
||||
if (!isString(grammar.language)) {
|
||||
// ignore the grammars that are only used as includes in other grammars
|
||||
return;
|
||||
}
|
||||
let language = byId[grammar.language];
|
||||
|
||||
if (language) {
|
||||
|
@ -160,6 +165,10 @@ class LanguageTableRenderer extends Disposable implements IExtensionFeatureTable
|
|||
|
||||
const snippets = contributes?.snippets || [];
|
||||
snippets.forEach(snippet => {
|
||||
if (!isString(snippet.language)) {
|
||||
// ignore invalid snippets
|
||||
return;
|
||||
}
|
||||
let language = byId[snippet.language];
|
||||
|
||||
if (language) {
|
||||
|
|
|
@ -171,7 +171,7 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate
|
|||
}
|
||||
}
|
||||
|
||||
const validLanguageId = grammar.language && this._languageService.isRegisteredLanguageId(grammar.language) ? grammar.language : null;
|
||||
const validLanguageId = grammar.language && this._languageService.isRegisteredLanguageId(grammar.language) ? grammar.language : undefined;
|
||||
|
||||
function asStringArray(array: unknown, defaultValue: string[]): string[] {
|
||||
if (!Array.isArray(array)) {
|
||||
|
@ -185,7 +185,7 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate
|
|||
|
||||
return {
|
||||
location: grammarLocation,
|
||||
language: validLanguageId || undefined,
|
||||
language: validLanguageId,
|
||||
scopeName: grammar.scopeName,
|
||||
embeddedLanguages: embeddedLanguages,
|
||||
tokenTypes: tokenTypes,
|
||||
|
|
|
@ -16,7 +16,7 @@ export interface TokenTypesContribution {
|
|||
}
|
||||
|
||||
export interface ITMSyntaxExtensionPoint {
|
||||
language: string;
|
||||
language?: string; // undefined if the grammar is only included by other grammars
|
||||
scopeName: string;
|
||||
path: string;
|
||||
embeddedLanguages: IEmbeddedLanguagesMap;
|
||||
|
|
Loading…
Reference in a new issue