🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
2
node_modules/@astrojs/language-server/dist/plugins/css/features/astro-selectors.d.ts
generated
vendored
Normal file
2
node_modules/@astrojs/language-server/dist/plugins/css/features/astro-selectors.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import type { IPseudoClassData } from 'vscode-css-languageservice';
|
||||
export declare const pseudoClass: IPseudoClassData[];
|
||||
15
node_modules/@astrojs/language-server/dist/plugins/css/features/astro-selectors.js
generated
vendored
Normal file
15
node_modules/@astrojs/language-server/dist/plugins/css/features/astro-selectors.js
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pseudoClass = void 0;
|
||||
exports.pseudoClass = [
|
||||
{
|
||||
name: ':global()',
|
||||
description: 'Apply styles to a selector globally',
|
||||
references: [
|
||||
{
|
||||
name: 'Astro documentation',
|
||||
url: 'https://docs.astro.build/en/guides/styling/#global-styles-within-style-tag',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
19
node_modules/@astrojs/language-server/dist/plugins/css/features/getIdClassCompletions.d.ts
generated
vendored
Normal file
19
node_modules/@astrojs/language-server/dist/plugins/css/features/getIdClassCompletions.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import type { Stylesheet } from 'vscode-css-languageservice';
|
||||
import { CompletionItem, CompletionList } from 'vscode-languageserver';
|
||||
import type { AttributeContext } from '../../../core/documents/parseHtml';
|
||||
export declare function getIdClassCompletion(stylesheets: Stylesheet[], attributeContext: AttributeContext): CompletionList | null;
|
||||
/**
|
||||
* incomplete see
|
||||
* https://github.com/microsoft/vscode-css-languageservice/blob/master/src/parser/cssNodes.ts#L14
|
||||
* The enum is not exported. we have to update this whenever it changes
|
||||
*/
|
||||
export declare enum NodeType {
|
||||
ClassSelector = 14,
|
||||
IdentifierSelector = 15
|
||||
}
|
||||
export type CSSNode = {
|
||||
type: number;
|
||||
children: CSSNode[] | undefined;
|
||||
getText(): string;
|
||||
};
|
||||
export declare function collectSelectors(stylesheets: CSSNode[], type: number): CompletionItem[];
|
||||
57
node_modules/@astrojs/language-server/dist/plugins/css/features/getIdClassCompletions.js
generated
vendored
Normal file
57
node_modules/@astrojs/language-server/dist/plugins/css/features/getIdClassCompletions.js
generated
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.collectSelectors = exports.NodeType = exports.getIdClassCompletion = void 0;
|
||||
const vscode_languageserver_1 = require("vscode-languageserver");
|
||||
function getIdClassCompletion(stylesheets, attributeContext) {
|
||||
const collectingType = getCollectingType(attributeContext);
|
||||
if (!collectingType) {
|
||||
return null;
|
||||
}
|
||||
const items = collectSelectors(stylesheets, collectingType);
|
||||
return vscode_languageserver_1.CompletionList.create(items);
|
||||
}
|
||||
exports.getIdClassCompletion = getIdClassCompletion;
|
||||
function getCollectingType(attributeContext) {
|
||||
if (attributeContext.inValue) {
|
||||
if (attributeContext.name === 'class') {
|
||||
return NodeType.ClassSelector;
|
||||
}
|
||||
if (attributeContext.name === 'id') {
|
||||
return NodeType.IdentifierSelector;
|
||||
}
|
||||
}
|
||||
else if (attributeContext.name.startsWith('class:')) {
|
||||
return NodeType.ClassSelector;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* incomplete see
|
||||
* https://github.com/microsoft/vscode-css-languageservice/blob/master/src/parser/cssNodes.ts#L14
|
||||
* The enum is not exported. we have to update this whenever it changes
|
||||
*/
|
||||
var NodeType;
|
||||
(function (NodeType) {
|
||||
NodeType[NodeType["ClassSelector"] = 14] = "ClassSelector";
|
||||
NodeType[NodeType["IdentifierSelector"] = 15] = "IdentifierSelector";
|
||||
})(NodeType = exports.NodeType || (exports.NodeType = {}));
|
||||
function collectSelectors(stylesheets, type) {
|
||||
const result = [];
|
||||
stylesheets.forEach((stylesheet) => {
|
||||
walk(stylesheet, (node) => {
|
||||
if (node.type === type) {
|
||||
result.push(node);
|
||||
}
|
||||
});
|
||||
});
|
||||
return result.map((node) => ({
|
||||
label: node.getText().substring(1),
|
||||
kind: vscode_languageserver_1.CompletionItemKind.Keyword,
|
||||
}));
|
||||
}
|
||||
exports.collectSelectors = collectSelectors;
|
||||
function walk(node, callback) {
|
||||
callback(node);
|
||||
if (node.children) {
|
||||
node.children.forEach((childrenNode) => walk(childrenNode, callback));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue