The feature page of vscode.html plugin is empty (#214455)

This commit is contained in:
Martin Aeschlimann 2024-06-06 15:50:10 +02:00 committed by GitHub
parent 86f1484693
commit 43c8fe13e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 4 deletions

View file

@ -41,7 +41,7 @@ export interface IDebugger {
}
export interface IGrammar {
language: string;
language?: string;
}
export interface IJSONValidation {

View file

@ -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) {

View file

@ -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,

View file

@ -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;