Merge branch 'preview'
This commit is contained in:
commit
8f645543b1
172 changed files with 60788 additions and 10320 deletions
4
.changes/unreleased/Changed-20240203-163343.yaml
Normal file
4
.changes/unreleased/Changed-20240203-163343.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
project: extensions/vscode
|
||||
kind: Changed
|
||||
body: config.ts only runs in NodeJS, not browser
|
||||
time: 2024-02-03T16:33:43.006333-08:00
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -152,4 +152,4 @@ continue_server.build
|
|||
continue_server.dist
|
||||
|
||||
Icon
|
||||
Icon?
|
||||
Icon?
|
||||
|
|
|
|||
5
.vscode/launch.json
vendored
5
.vscode/launch.json
vendored
|
|
@ -41,10 +41,7 @@
|
|||
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode"
|
||||
],
|
||||
"outFiles": ["${workspaceFolder}/extensions/vscode/out/**/*.js"],
|
||||
"preLaunchTask": "vscode-extension:build",
|
||||
"env": {
|
||||
"CONTINUE_SERVER_URL": "http://localhost:8001"
|
||||
}
|
||||
"preLaunchTask": "vscode-extension:build"
|
||||
},
|
||||
// Has to be run after starting the server (separately or using the compound configuration)
|
||||
{
|
||||
|
|
|
|||
22
.vscode/tasks.json
vendored
22
.vscode/tasks.json
vendored
|
|
@ -10,7 +10,9 @@
|
|||
// To build the React app that is used in the extension
|
||||
"vscode-extension:continue-ui:build",
|
||||
// To bundle the code the same way we do for publishing
|
||||
"vscode-extension:esbuild"
|
||||
"vscode-extension:esbuild",
|
||||
// Start the React app that is used in the extension
|
||||
"gui:dev"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
|
|
@ -117,7 +119,23 @@
|
|||
},
|
||||
"args": ["run", "dev"],
|
||||
"isBackground": true,
|
||||
"problemMatcher": ["$tsc"]
|
||||
"problemMatcher": [
|
||||
{
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": ".",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"message": 3
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": ".",
|
||||
"endsPattern": "."
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
82
core/autocomplete/cache.ts
Normal file
82
core/autocomplete/cache.ts
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
import { open } from "sqlite";
|
||||
import sqlite3 from "sqlite3";
|
||||
import { DatabaseConnection } from "../indexing/refreshIndex";
|
||||
import { getTabAutocompleteCacheSqlitePath } from "../util/paths";
|
||||
|
||||
export class AutocompleteLruCache {
|
||||
private static capacity: number = 1000;
|
||||
|
||||
db: DatabaseConnection;
|
||||
|
||||
constructor(db: DatabaseConnection) {
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
static async get(): Promise<AutocompleteLruCache> {
|
||||
const db = await open({
|
||||
filename: getTabAutocompleteCacheSqlitePath(),
|
||||
driver: sqlite3.Database,
|
||||
});
|
||||
|
||||
await db.run(`
|
||||
CREATE TABLE IF NOT EXISTS cache (
|
||||
key TEXT PRIMARY KEY,
|
||||
value TEXT NOT NULL,
|
||||
timestamp INTEGER NOT NULL
|
||||
)
|
||||
`);
|
||||
|
||||
return new AutocompleteLruCache(db);
|
||||
}
|
||||
|
||||
async get(key: string): Promise<string | undefined> {
|
||||
const result = await this.db.get(
|
||||
"SELECT value FROM cache WHERE key = ?",
|
||||
key
|
||||
);
|
||||
|
||||
if (result) {
|
||||
await this.db.run(
|
||||
"UPDATE cache SET timestamp = ? WHERE key = ?",
|
||||
Date.now(),
|
||||
key
|
||||
);
|
||||
return result.value;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async put(key: string, value: string) {
|
||||
const result = await this.db.get(
|
||||
"SELECT key FROM cache WHERE key = ?",
|
||||
key
|
||||
);
|
||||
|
||||
if (result) {
|
||||
await this.db.run(
|
||||
"UPDATE cache SET value = ?, timestamp = ? WHERE key = ?",
|
||||
value,
|
||||
Date.now(),
|
||||
key
|
||||
);
|
||||
} else {
|
||||
const count = await this.db.get("SELECT COUNT(*) as count FROM cache");
|
||||
|
||||
if (count.count >= AutocompleteLruCache.capacity) {
|
||||
await this.db.run(
|
||||
"DELETE FROM cache WHERE key = (SELECT key FROM cache ORDER BY timestamp ASC LIMIT 1)"
|
||||
);
|
||||
}
|
||||
|
||||
await this.db.run(
|
||||
"INSERT INTO cache (key, value, timestamp) VALUES (?, ?, ?)",
|
||||
key,
|
||||
value,
|
||||
Date.now()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default AutocompleteLruCache;
|
||||
23
core/autocomplete/charStream.ts
Normal file
23
core/autocomplete/charStream.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
export async function* onlyWhitespaceAfterEndOfLine(
|
||||
stream: AsyncGenerator<string>,
|
||||
endOfLine: string[]
|
||||
): AsyncGenerator<string> {
|
||||
let pending = "";
|
||||
for await (let chunk of stream) {
|
||||
chunk = pending + chunk;
|
||||
pending = "";
|
||||
for (let i = 0; i < chunk.length - 1; i++) {
|
||||
if (endOfLine.includes(chunk[i]) && chunk[i + 1] === " ") {
|
||||
yield chunk.slice(0, i + 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (endOfLine.includes(chunk[chunk.length - 1])) {
|
||||
pending = chunk[chunk.length - 1];
|
||||
yield chunk.slice(0, chunk.length - 1);
|
||||
} else {
|
||||
yield chunk;
|
||||
}
|
||||
}
|
||||
yield pending;
|
||||
}
|
||||
132
core/autocomplete/constructPrompt.ts
Normal file
132
core/autocomplete/constructPrompt.ts
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
import Parser from "web-tree-sitter";
|
||||
import { TabAutocompleteOptions } from "..";
|
||||
import {
|
||||
countTokens,
|
||||
pruneLinesFromBottom,
|
||||
pruneLinesFromTop,
|
||||
} from "../llm/countTokens";
|
||||
import { getBasename } from "../util";
|
||||
import { getParserForFile } from "../util/treeSitter";
|
||||
import { AutocompleteLanguageInfo, LANGUAGES, Typescript } from "./languages";
|
||||
|
||||
export function languageForFilepath(
|
||||
filepath: string
|
||||
): AutocompleteLanguageInfo {
|
||||
return LANGUAGES[filepath.split(".").slice(-1)[0]] || Typescript;
|
||||
}
|
||||
|
||||
function formatExternalSnippet(
|
||||
filepath: string,
|
||||
snippet: string,
|
||||
language: AutocompleteLanguageInfo
|
||||
) {
|
||||
const comment = language.comment;
|
||||
const lines = [
|
||||
comment + " Path: " + getBasename(filepath),
|
||||
...snippet.split("\n").map((line) => comment + " " + line),
|
||||
comment,
|
||||
];
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
async function getTreePathAtCursor(
|
||||
filepath: string,
|
||||
fileContents: string,
|
||||
cursorIndex: number
|
||||
): Promise<Parser.SyntaxNode[] | undefined> {
|
||||
const parser = await getParserForFile(filepath);
|
||||
|
||||
if (!parser) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const ast = parser.parse(fileContents);
|
||||
const path = [ast.rootNode];
|
||||
while (path[path.length - 1].childCount > 0) {
|
||||
let foundChild = false;
|
||||
for (let child of path[path.length - 1].children) {
|
||||
if (child.startIndex <= cursorIndex && child.endIndex >= cursorIndex) {
|
||||
path.push(child);
|
||||
foundChild = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundChild) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
export interface AutocompleteSnippet {
|
||||
filepath: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export async function constructAutocompletePrompt(
|
||||
filepath: string,
|
||||
fullPrefix: string,
|
||||
fullSuffix: string,
|
||||
clipboardText: string,
|
||||
language: AutocompleteLanguageInfo,
|
||||
getDefinition: (
|
||||
filepath: string,
|
||||
line: number,
|
||||
character: number
|
||||
) => Promise<AutocompleteSnippet | undefined>,
|
||||
options: TabAutocompleteOptions
|
||||
): Promise<{ prefix: string; suffix: string; useFim: boolean }> {
|
||||
// Find external snippets
|
||||
const snippets: AutocompleteSnippet[] = [];
|
||||
|
||||
const treePath = await getTreePathAtCursor(
|
||||
filepath,
|
||||
fullPrefix + fullSuffix,
|
||||
fullPrefix.length
|
||||
);
|
||||
|
||||
// Get function def when inside call expression
|
||||
if (treePath) {
|
||||
let callExpression = undefined;
|
||||
for (let node of treePath.reverse()) {
|
||||
if (node.type === "call_expression") {
|
||||
callExpression = node;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (callExpression) {
|
||||
const definition = await getDefinition(
|
||||
filepath,
|
||||
callExpression.startPosition.row,
|
||||
callExpression.startPosition.column
|
||||
);
|
||||
if (definition) {
|
||||
snippets.push(definition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Construct basic prefix / suffix
|
||||
const formattedSnippets = snippets
|
||||
.map((snippet) =>
|
||||
formatExternalSnippet(snippet.filepath, snippet.content, language)
|
||||
)
|
||||
.join("\n");
|
||||
const maxPrefixTokens =
|
||||
options.maxPromptTokens * options.prefixPercentage -
|
||||
countTokens(formattedSnippets, "gpt-4");
|
||||
let prefix = pruneLinesFromTop(fullPrefix, maxPrefixTokens);
|
||||
if (formattedSnippets.length > 0) {
|
||||
prefix = formattedSnippets + "\n" + prefix;
|
||||
}
|
||||
|
||||
const maxSuffixTokens = Math.min(
|
||||
options.maxPromptTokens - countTokens(prefix, "gpt-4"),
|
||||
options.maxSuffixPercentage * options.maxPromptTokens
|
||||
);
|
||||
let suffix = pruneLinesFromBottom(fullSuffix, maxSuffixTokens);
|
||||
|
||||
return { prefix, suffix, useFim: true };
|
||||
}
|
||||
0
core/autocomplete/index.ts
Normal file
0
core/autocomplete/index.ts
Normal file
33
core/autocomplete/languages.ts
Normal file
33
core/autocomplete/languages.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
export interface AutocompleteLanguageInfo {
|
||||
stopWords: string[];
|
||||
comment: string;
|
||||
endOfLine: string[];
|
||||
}
|
||||
|
||||
export const Typescript = {
|
||||
stopWords: ["function", "class", "module", "export "],
|
||||
comment: "//",
|
||||
endOfLine: [";"],
|
||||
};
|
||||
|
||||
export const Python = {
|
||||
stopWords: ["def", "class"],
|
||||
comment: "#",
|
||||
endOfLine: [""],
|
||||
};
|
||||
|
||||
export const Java = {
|
||||
stopWords: ["class", "function"],
|
||||
comment: "//",
|
||||
endOfLine: [";"],
|
||||
};
|
||||
|
||||
export const LANGUAGES: { [extension: string]: AutocompleteLanguageInfo } = {
|
||||
ts: Typescript,
|
||||
js: Typescript,
|
||||
tsx: Typescript,
|
||||
jsx: Typescript,
|
||||
py: Python,
|
||||
pyi: Python,
|
||||
java: Java,
|
||||
};
|
||||
39
core/autocomplete/lineStream.ts
Normal file
39
core/autocomplete/lineStream.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { distance } from "fastest-levenshtein";
|
||||
import { LineStream } from "../diff/util";
|
||||
|
||||
export async function* streamWithNewLines(stream: LineStream): LineStream {
|
||||
let firstLine = true;
|
||||
for await (const nextLine of stream) {
|
||||
if (!firstLine) {
|
||||
yield "\n";
|
||||
}
|
||||
firstLine = false;
|
||||
yield nextLine;
|
||||
}
|
||||
}
|
||||
|
||||
const brackets = ["(", "[", "{", "`", '"""'];
|
||||
const bracketsReverse = [")", "]", "}", "`", '"""'];
|
||||
|
||||
export async function* stopAtSimilarLine(
|
||||
stream: LineStream,
|
||||
line: string
|
||||
): AsyncGenerator<string> {
|
||||
line = line.trim();
|
||||
for await (const nextLine of stream) {
|
||||
if (
|
||||
bracketsReverse.includes(nextLine.trim()) &&
|
||||
bracketsReverse.includes(line.trim()) &&
|
||||
line.trim() === nextLine.trim()
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const dist = distance(nextLine.trim(), line);
|
||||
let lineQualifies = nextLine.length > 4 && line.length > 4;
|
||||
if (lineQualifies && dist / line.length < 0.1) {
|
||||
break;
|
||||
}
|
||||
yield nextLine;
|
||||
}
|
||||
}
|
||||
10
core/autocomplete/parameters.ts
Normal file
10
core/autocomplete/parameters.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { TabAutocompleteOptions } from "..";
|
||||
|
||||
export const DEFAULT_AUTOCOMPLETE_OPTS: TabAutocompleteOptions = {
|
||||
useCopyBuffer: true,
|
||||
useSuffix: true,
|
||||
maxPromptTokens: 650,
|
||||
prefixPercentage: 0.85,
|
||||
maxSuffixPercentage: 0.25,
|
||||
debounceDelay: 350,
|
||||
};
|
||||
70
core/autocomplete/templates.ts
Normal file
70
core/autocomplete/templates.ts
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
// Fill in the middle prompts
|
||||
|
||||
import { CompletionOptions } from "..";
|
||||
|
||||
interface AutocompleteTemplate {
|
||||
template: string | ((prefix: string, suffix: string) => string);
|
||||
completionOptions?: Partial<CompletionOptions>;
|
||||
}
|
||||
|
||||
// https://huggingface.co/stabilityai/stable-code-3b
|
||||
const stableCodeFimTemplate: AutocompleteTemplate = {
|
||||
template: "<fim_prefix>{{{prefix}}}<fim_suffix>{{{suffix}}}<fim_middle>",
|
||||
completionOptions: {
|
||||
stop: ["<fim_prefix>", "<fim_suffix>", "<fim_middle>", "<|endoftext|>"],
|
||||
},
|
||||
};
|
||||
|
||||
const codeLlamaFimTemplate: AutocompleteTemplate = {
|
||||
template: "<PRE> {{{prefix}}} <SUF>{{{suffix}}} <MID>",
|
||||
completionOptions: { stop: ["<PRE>", "<SUF>", "<MID>"] },
|
||||
};
|
||||
|
||||
// https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-base
|
||||
const deepseekFimTemplate: AutocompleteTemplate = {
|
||||
template:
|
||||
"<|fim▁begin|>{{{prefix}}}<|fim▁hole|>{{{suffix}}}<|fim▁end|>",
|
||||
completionOptions: {
|
||||
stop: ["<|fim▁begin|>", "<|fim▁hole|>", "<|fim▁end|>", "//"],
|
||||
},
|
||||
};
|
||||
|
||||
const deepseekFimTemplateWrongPipeChar: AutocompleteTemplate = {
|
||||
template: "<|fim▁begin|>{{{prefix}}}<|fim▁hole|>{{{suffix}}}<|fim▁end|>",
|
||||
completionOptions: { stop: ["<|fim▁begin|>", "<|fim▁hole|>", "<|fim▁end|>"] },
|
||||
};
|
||||
|
||||
const gptAutocompleteTemplate: AutocompleteTemplate = {
|
||||
template: `Your task is to complete the line at the end of this code block:
|
||||
\`\`\`
|
||||
{{{prefix}}}
|
||||
\`\`\`
|
||||
|
||||
The last line is incomplete, and you should provide the rest of that line. If the line is already complete, just return a new line. Otherwise, DO NOT provide explanation, a code block, or extra whitespace, just the code that should be added to the last line to complete it:`,
|
||||
completionOptions: { stop: ["\n"] },
|
||||
};
|
||||
|
||||
export function getTemplateForModel(model: string): AutocompleteTemplate {
|
||||
const lowerCaseModel = model.toLowerCase()
|
||||
if (
|
||||
lowerCaseModel.includes("starcoder") ||
|
||||
lowerCaseModel.includes("star-coder") ||
|
||||
lowerCaseModel.includes("stable")
|
||||
) {
|
||||
return stableCodeFimTemplate;
|
||||
}
|
||||
|
||||
if (lowerCaseModel.includes("codellama")) {
|
||||
return codeLlamaFimTemplate;
|
||||
}
|
||||
|
||||
if (lowerCaseModel.includes("deepseek")) {
|
||||
return deepseekFimTemplate;
|
||||
}
|
||||
|
||||
if (lowerCaseModel.includes("gpt")) {
|
||||
return gptAutocompleteTemplate;
|
||||
}
|
||||
|
||||
return stableCodeFimTemplate;
|
||||
}
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
import * as fs from "fs";
|
||||
import {
|
||||
BaseCompletionOptions,
|
||||
Config,
|
||||
ContextProviderDescription,
|
||||
ContextProviderWithParams,
|
||||
ContinueConfig,
|
||||
CustomContextProvider,
|
||||
|
|
@ -9,7 +12,9 @@ import {
|
|||
ModelDescription,
|
||||
SerializedContinueConfig,
|
||||
SlashCommand,
|
||||
SlashCommandDescription,
|
||||
} from "..";
|
||||
|
||||
import {
|
||||
slashCommandFromDescription,
|
||||
slashFromCustomCommand,
|
||||
|
|
@ -22,6 +27,100 @@ import TransformersJsEmbeddingsProvider from "../indexing/embeddings/Transformer
|
|||
import { BaseLLM } from "../llm";
|
||||
import { llmFromDescription } from "../llm/llms";
|
||||
import CustomLLMClass from "../llm/llms/CustomLLM";
|
||||
import mergeJson from "../util/merge";
|
||||
import {
|
||||
getConfigJsPath,
|
||||
getConfigJsonPath,
|
||||
getConfigTsPath,
|
||||
migrate,
|
||||
} from "../util/paths";
|
||||
|
||||
function loadSerializedConfig(
|
||||
workspaceConfigs: Partial<SerializedContinueConfig>[]
|
||||
): SerializedContinueConfig {
|
||||
const configPath = getConfigJsonPath();
|
||||
let contents = fs.readFileSync(configPath, "utf8");
|
||||
let config = JSON.parse(contents) as SerializedContinueConfig;
|
||||
if (config.allowAnonymousTelemetry === undefined) {
|
||||
config.allowAnonymousTelemetry = true;
|
||||
}
|
||||
|
||||
// Migrate to camelCase - replace all instances of "snake_case" with "camelCase"
|
||||
migrate("camelCaseConfig", () => {
|
||||
contents = contents
|
||||
.replace(/(_\w)/g, function (m) {
|
||||
return m[1].toUpperCase();
|
||||
})
|
||||
.replace("openai-aiohttp", "openai");
|
||||
|
||||
fs.writeFileSync(configPath, contents, "utf8");
|
||||
});
|
||||
|
||||
migrate("codebaseContextProvider", () => {
|
||||
if (
|
||||
!config.contextProviders?.filter((cp) => cp.name === "codebase")?.length
|
||||
) {
|
||||
config.contextProviders = [
|
||||
...(config.contextProviders || []),
|
||||
{
|
||||
name: "codebase",
|
||||
params: {},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
if (!config.embeddingsProvider) {
|
||||
config.embeddingsProvider = {
|
||||
provider: "transformers.js",
|
||||
};
|
||||
}
|
||||
|
||||
fs.writeFileSync(configPath, JSON.stringify(config, undefined, 2), "utf8");
|
||||
});
|
||||
|
||||
migrate("problemsContextProvider", () => {
|
||||
if (
|
||||
!config.contextProviders?.filter((cp) => cp.name === "problems")?.length
|
||||
) {
|
||||
config.contextProviders = [
|
||||
...(config.contextProviders || []),
|
||||
{
|
||||
name: "problems",
|
||||
params: {},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
fs.writeFileSync(configPath, JSON.stringify(config, undefined, 2), "utf8");
|
||||
});
|
||||
|
||||
migrate("foldersContextProvider", () => {
|
||||
if (
|
||||
!config.contextProviders?.filter((cp) => cp.name === "folder")?.length
|
||||
) {
|
||||
config.contextProviders = [
|
||||
...(config.contextProviders || []),
|
||||
{
|
||||
name: "folder",
|
||||
params: {},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
fs.writeFileSync(configPath, JSON.stringify(config, undefined, 2), "utf8");
|
||||
});
|
||||
|
||||
migrate("renameFreeTrialProvider", () => {
|
||||
contents = contents.replace(/openai-free-trial/g, "free-trial");
|
||||
fs.writeFileSync(configPath, contents, "utf8");
|
||||
});
|
||||
|
||||
for (const workspaceConfig of workspaceConfigs) {
|
||||
config = mergeJson(config, workspaceConfig);
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
function serializedToIntermediateConfig(
|
||||
initial: SerializedContinueConfig
|
||||
|
|
@ -80,6 +179,20 @@ async function intermediateToFinalConfig(
|
|||
models.push(llm);
|
||||
}
|
||||
|
||||
let autocompleteLlm: BaseLLM | undefined = undefined;
|
||||
if (config.tabAutocompleteModel) {
|
||||
if (isModelDescription(config.tabAutocompleteModel)) {
|
||||
autocompleteLlm = await llmFromDescription(
|
||||
config.tabAutocompleteModel,
|
||||
readFile,
|
||||
config.completionOptions,
|
||||
config.systemMessage
|
||||
);
|
||||
} else {
|
||||
autocompleteLlm = new CustomLLMClass(config.tabAutocompleteModel);
|
||||
}
|
||||
}
|
||||
|
||||
const contextProviders: IContextProvider[] = [new FileContextProvider({})];
|
||||
for (const provider of config.contextProviders || []) {
|
||||
if (isContextProviderWithParams(provider)) {
|
||||
|
|
@ -112,7 +225,117 @@ async function intermediateToFinalConfig(
|
|||
contextProviders,
|
||||
models,
|
||||
embeddingsProvider: config.embeddingsProvider as any,
|
||||
tabAutocompleteModel: autocompleteLlm,
|
||||
};
|
||||
}
|
||||
|
||||
export { intermediateToFinalConfig, serializedToIntermediateConfig };
|
||||
interface BrowserSerializedContinueConfig {
|
||||
allowAnonymousTelemetry?: boolean;
|
||||
models: ModelDescription[];
|
||||
systemMessage?: string;
|
||||
completionOptions?: BaseCompletionOptions;
|
||||
slashCommands?: SlashCommandDescription[];
|
||||
contextProviders?: ContextProviderDescription[];
|
||||
disableIndexing?: boolean;
|
||||
disableSessionTitles?: boolean;
|
||||
userToken?: string;
|
||||
embeddingsProvider?: string;
|
||||
}
|
||||
|
||||
function finalToBrowserConfig(
|
||||
final: ContinueConfig
|
||||
): BrowserSerializedContinueConfig {
|
||||
return {
|
||||
allowAnonymousTelemetry: final.allowAnonymousTelemetry,
|
||||
models: final.models.map((m) => ({
|
||||
provider: m.providerName,
|
||||
model: m.model,
|
||||
title: m.title || m.model,
|
||||
apiKey: m.apiKey,
|
||||
apiBase: m.apiBase,
|
||||
contextLength: m.contextLength,
|
||||
template: m.template,
|
||||
completionOptions: m.completionOptions,
|
||||
systemMessage: m.systemMessage,
|
||||
requestOptions: m.requestOptions,
|
||||
promptTemplates: m.promptTemplates,
|
||||
})),
|
||||
systemMessage: final.systemMessage,
|
||||
completionOptions: final.completionOptions,
|
||||
slashCommands: final.slashCommands?.map((m) => ({
|
||||
name: m.name,
|
||||
description: m.description,
|
||||
options: m.params,
|
||||
})),
|
||||
contextProviders: final.contextProviders?.map((c) => c.description),
|
||||
disableIndexing: final.disableIndexing,
|
||||
disableSessionTitles: final.disableSessionTitles,
|
||||
userToken: final.userToken,
|
||||
embeddingsProvider: final.embeddingsProvider?.id,
|
||||
};
|
||||
}
|
||||
|
||||
async function buildConfigTs(browser: boolean) {
|
||||
if (!fs.existsSync(getConfigTsPath())) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
// Dynamic import esbuild so potentially disastrous errors can be caught
|
||||
const esbuild = require("esbuild");
|
||||
|
||||
await esbuild.build({
|
||||
entryPoints: [getConfigTsPath()],
|
||||
bundle: true,
|
||||
platform: browser ? "browser" : "node",
|
||||
format: browser ? "esm" : "cjs",
|
||||
outfile: getConfigJsPath(!browser),
|
||||
external: ["fetch", "fs", "path", "os", "child_process"],
|
||||
sourcemap: true,
|
||||
});
|
||||
} catch (e) {
|
||||
throw new Error(
|
||||
"Build error. Please check your ~/.continue/config.ts file: " + e
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(getConfigJsPath(!browser))) {
|
||||
return undefined;
|
||||
}
|
||||
return fs.readFileSync(getConfigJsPath(!browser), "utf8");
|
||||
}
|
||||
|
||||
async function loadFullConfigNode(
|
||||
readFile: (filepath: string) => Promise<string>,
|
||||
workspaceConfigs: Partial<SerializedContinueConfig>[]
|
||||
): Promise<ContinueConfig> {
|
||||
let serialized = loadSerializedConfig(workspaceConfigs);
|
||||
let intermediate = serializedToIntermediateConfig(serialized);
|
||||
|
||||
const configJsContents = await buildConfigTs(false);
|
||||
if (configJsContents) {
|
||||
try {
|
||||
// Try config.ts first
|
||||
const configJsPath = getConfigJsPath(true);
|
||||
const module = await require(configJsPath);
|
||||
delete require.cache[require.resolve(configJsPath)];
|
||||
if (!module.modifyConfig) {
|
||||
throw new Error("config.ts does not export a modifyConfig function.");
|
||||
}
|
||||
intermediate = module.modifyConfig(intermediate);
|
||||
} catch (e) {
|
||||
console.log("Error loading config.ts: ", e);
|
||||
}
|
||||
}
|
||||
const finalConfig = await intermediateToFinalConfig(intermediate, readFile);
|
||||
return finalConfig;
|
||||
}
|
||||
|
||||
export {
|
||||
finalToBrowserConfig,
|
||||
intermediateToFinalConfig,
|
||||
loadFullConfigNode,
|
||||
serializedToIntermediateConfig,
|
||||
type BrowserSerializedContinueConfig,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -533,7 +533,6 @@ declare global {
|
|||
}
|
||||
|
||||
export interface SerializedContinueConfig {
|
||||
disallowedSteps?: string[];
|
||||
allowAnonymousTelemetry?: boolean;
|
||||
models: ModelDescription[];
|
||||
systemMessage?: string;
|
||||
|
|
|
|||
61
core/context/providers/CodeHighlightsContextProvider.ts
Normal file
61
core/context/providers/CodeHighlightsContextProvider.ts
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import { BaseContextProvider } from "..";
|
||||
import {
|
||||
ContextItem,
|
||||
ContextProviderDescription,
|
||||
ContextProviderExtras,
|
||||
} from "../..";
|
||||
import { getBasename } from "../../util";
|
||||
|
||||
const highlighterPromise = import("llm-code-highlighter/dist/index.continue");
|
||||
|
||||
class CodeHighlightsContextProvider extends BaseContextProvider {
|
||||
static description: ContextProviderDescription = {
|
||||
title: "highlights",
|
||||
displayTitle: "Highlights",
|
||||
description: "Code highlights from open files",
|
||||
type: "normal",
|
||||
};
|
||||
|
||||
async getContextItems(
|
||||
query: string,
|
||||
extras: ContextProviderExtras
|
||||
): Promise<ContextItem[]> {
|
||||
const ide = extras.ide;
|
||||
const openFiles = await ide.getOpenFiles();
|
||||
const allFiles: { name: string; absPath: string; content: string }[] =
|
||||
await Promise.all(
|
||||
openFiles.map(async (filepath: string) => {
|
||||
return {
|
||||
name: getBasename(filepath),
|
||||
absPath: filepath,
|
||||
content: `${await ide.readFile(filepath)}`,
|
||||
};
|
||||
})
|
||||
);
|
||||
const topPercentile = 0.5;
|
||||
const highlighter = await highlighterPromise;
|
||||
const repoMap = await highlighter.getRepoHighlights(
|
||||
topPercentile,
|
||||
[],
|
||||
allFiles
|
||||
.filter((file) => file.content.length > 0)
|
||||
.map((file) => {
|
||||
return {
|
||||
relPath: file.name,
|
||||
code: file.content,
|
||||
};
|
||||
})
|
||||
);
|
||||
return [
|
||||
{
|
||||
content: repoMap ? repoMap : "",
|
||||
name: "Code Highlights",
|
||||
description: "Code highlights from open files",
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
async load(): Promise<void> {}
|
||||
}
|
||||
|
||||
export default CodeHighlightsContextProvider;
|
||||
|
|
@ -4,6 +4,7 @@ import {
|
|||
ContextProviderDescription,
|
||||
ContextProviderExtras,
|
||||
} from "../..";
|
||||
import { retrieveContextItemsFromEmbeddings } from "../retrieval";
|
||||
|
||||
class CodebaseContextProvider extends BaseContextProvider {
|
||||
static description: ContextProviderDescription = {
|
||||
|
|
@ -17,7 +18,6 @@ class CodebaseContextProvider extends BaseContextProvider {
|
|||
query: string,
|
||||
extras: ContextProviderExtras
|
||||
): Promise<ContextItem[]> {
|
||||
const { retrieveContextItemsFromEmbeddings } = await import("../retrieval");
|
||||
return retrieveContextItemsFromEmbeddings(extras, this.options, undefined);
|
||||
}
|
||||
async load(): Promise<void> {}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,15 @@ class ProblemsContextProvider extends BaseContextProvider {
|
|||
})
|
||||
);
|
||||
|
||||
return items;
|
||||
return items.length === 0
|
||||
? [
|
||||
{
|
||||
description: "Problems in current file",
|
||||
content: `There are no problems found in the open file.`,
|
||||
name: "No problems found",
|
||||
},
|
||||
]
|
||||
: items;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { BaseContextProvider } from "..";
|
||||
import { ContextProviderName } from "../..";
|
||||
import CodebaseContextProvider from "./CodebaseContextProvider";
|
||||
// import CodeHighlightsContextProvider from "./CodeHighlightsContextProvider";
|
||||
import DiffContextProvider from "./DiffContextProvider";
|
||||
import DocsContextProvider from "./DocsContextProvider";
|
||||
import FileTreeContextProvider from "./FileTreeContextProvider";
|
||||
|
|
@ -28,6 +29,7 @@ const Providers: (typeof BaseContextProvider)[] = [
|
|||
ProblemsContextProvider,
|
||||
FolderContextProvider,
|
||||
DocsContextProvider,
|
||||
// CodeHighlightsContextProvider,
|
||||
];
|
||||
|
||||
export function contextProviderClassFromName(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Chunk, ContextItem, ContextProviderExtras, ILLM } from "..";
|
|||
import { FullTextSearchCodebaseIndex } from "../indexing/FullTextSearch";
|
||||
import { ChunkCodebaseIndex } from "../indexing/chunk/ChunkCodebaseIndex";
|
||||
import { IndexTag } from "../indexing/types";
|
||||
import { llmCanGenerateInParallel } from "../llm";
|
||||
import { llmCanGenerateInParallel } from "../llm/autodetect";
|
||||
import { getBasename } from "../util";
|
||||
|
||||
const RERANK_PROMPT = (
|
||||
|
|
@ -111,12 +111,17 @@ export async function retrieveContextItemsFromEmbeddings(
|
|||
|
||||
const nFinal = options?.nFinal || 10;
|
||||
const useReranking =
|
||||
llmCanGenerateInParallel(extras.llm) &&
|
||||
llmCanGenerateInParallel(extras.llm.providerName, extras.llm.model) &&
|
||||
(options?.useReranking === undefined ? false : options?.useReranking);
|
||||
const nRetrieve = useReranking === false ? nFinal : options?.nRetrieve || 20;
|
||||
|
||||
const ftsIndex = new FullTextSearchCodebaseIndex();
|
||||
const workspaceDirs = await extras.ide.getWorkspaceDirs();
|
||||
|
||||
if (workspaceDirs.length === 0) {
|
||||
throw new Error("No workspace directories found");
|
||||
}
|
||||
|
||||
const branches = await Promise.all(
|
||||
workspaceDirs.map((dir) => extras.ide.getBranch(dir))
|
||||
);
|
||||
|
|
@ -126,13 +131,21 @@ export async function retrieveContextItemsFromEmbeddings(
|
|||
artifactId: ChunkCodebaseIndex.artifactId,
|
||||
}));
|
||||
|
||||
let ftsResults = await ftsIndex.retrieve(
|
||||
tags,
|
||||
extras.fullInput.trim().split(" ").join(" OR "),
|
||||
nRetrieve / 2,
|
||||
filterDirectory,
|
||||
undefined
|
||||
);
|
||||
let ftsResults: Chunk[] = [];
|
||||
|
||||
try {
|
||||
if (extras.fullInput.trim() !== "") {
|
||||
ftsResults = await ftsIndex.retrieve(
|
||||
tags,
|
||||
extras.fullInput.trim().split(" ").join(" OR "),
|
||||
nRetrieve / 2,
|
||||
filterDirectory,
|
||||
undefined
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Error retrieving from FTS:", e);
|
||||
}
|
||||
|
||||
let vecResults = await extras.ide.retrieveChunks(
|
||||
extras.fullInput,
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@ export function matchLine(
|
|||
/**
|
||||
* Convert a stream of arbitrary chunks to a stream of lines
|
||||
*/
|
||||
export async function* streamLines(streamCompletion: LineStream): LineStream {
|
||||
export async function* streamLines(
|
||||
streamCompletion: AsyncGenerator<string>
|
||||
): LineStream {
|
||||
let buffer = "";
|
||||
for await (const chunk of streamCompletion) {
|
||||
buffer += chunk;
|
||||
|
|
|
|||
|
|
@ -1,24 +1,11 @@
|
|||
import * as fs from "fs";
|
||||
import { DiffLine, IDE, Problem, SerializedContinueConfig } from "..";
|
||||
import { DiffLine, IDE, Problem } from "..";
|
||||
import { BrowserSerializedContinueConfig } from "../config/load";
|
||||
import { Chunk } from "../index";
|
||||
import {
|
||||
getConfigJsonPath,
|
||||
getConfigTsPath,
|
||||
getContinueGlobalPath,
|
||||
} from "../util/paths";
|
||||
import { getContinueGlobalPath } from "../util/paths";
|
||||
|
||||
class FileSystemIde implements IDE {
|
||||
async getSerializedConfig(): Promise<SerializedContinueConfig> {
|
||||
const configPath = getConfigJsonPath();
|
||||
let contents = fs.readFileSync(configPath, "utf8");
|
||||
return JSON.parse(contents) as SerializedContinueConfig;
|
||||
}
|
||||
|
||||
async getConfigJsUrl(): Promise<string | undefined> {
|
||||
if (!fs.existsSync(getConfigTsPath())) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async getSerializedConfig(): Promise<BrowserSerializedContinueConfig> {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,16 @@
|
|||
import { Chunk, DiffLine, Problem } from "..";
|
||||
import { IDE, SerializedContinueConfig } from "../index";
|
||||
import { BrowserSerializedContinueConfig } from "../config/load";
|
||||
import { IDE } from "../index";
|
||||
|
||||
import { ideRequest } from "./messaging";
|
||||
async function r(messageType: string, options: any = {}) {
|
||||
return await ideRequest(messageType, options);
|
||||
}
|
||||
export class ExtensionIde implements IDE {
|
||||
async getSerializedConfig(): Promise<SerializedContinueConfig> {
|
||||
async getSerializedConfig(): Promise<BrowserSerializedContinueConfig> {
|
||||
return await r("getSerializedConfig");
|
||||
}
|
||||
|
||||
async getConfigJsUrl(): Promise<string | undefined> {
|
||||
return await r("getConfigJsUrl");
|
||||
}
|
||||
|
||||
async getDiff() {
|
||||
return await r("getDiff");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// import "vscode-webview";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { ChatMessage, LLMFullCompletionOptions, LLMReturnValue } from "..";
|
||||
interface vscode {
|
||||
postMessage(message: any): vscode;
|
||||
}
|
||||
|
|
@ -65,7 +66,8 @@ export async function ideRequest(type: string, message: any): Promise<any> {
|
|||
|
||||
export async function* ideStreamRequest(
|
||||
type: string,
|
||||
message: any
|
||||
message: any,
|
||||
cancelToken?: AbortSignal
|
||||
): AsyncGenerator<any, any> {
|
||||
const messageId = uuidv4();
|
||||
|
||||
|
|
@ -89,6 +91,10 @@ export async function* ideStreamRequest(
|
|||
};
|
||||
window.addEventListener("message", handler);
|
||||
|
||||
cancelToken?.addEventListener("abort", () => {
|
||||
postToIde("abort", { messageId });
|
||||
});
|
||||
|
||||
while (!done) {
|
||||
if (buffer.length > index) {
|
||||
const chunk = buffer.slice(index);
|
||||
|
|
@ -106,3 +112,27 @@ export async function* ideStreamRequest(
|
|||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
export async function* llmStreamChat(
|
||||
modelTitle: string,
|
||||
cancelToken: AbortSignal | undefined,
|
||||
messages: ChatMessage[],
|
||||
options: LLMFullCompletionOptions = {}
|
||||
): AsyncGenerator<ChatMessage, LLMReturnValue> {
|
||||
const gen = ideStreamRequest(
|
||||
"llmStreamChat",
|
||||
{
|
||||
messages,
|
||||
title: modelTitle,
|
||||
completionOptions: options,
|
||||
},
|
||||
cancelToken
|
||||
);
|
||||
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
yield { role: "user", content: next.value };
|
||||
next = await gen.next();
|
||||
}
|
||||
return { prompt: next.value?.prompt, completion: next.value?.completion };
|
||||
}
|
||||
|
|
|
|||
32
core/index.d.ts
vendored
32
core/index.d.ts
vendored
|
|
@ -1,3 +1,5 @@
|
|||
import { BrowserSerializedContinueConfig } from "./config/load";
|
||||
|
||||
export interface ChunkWithoutID {
|
||||
content: string;
|
||||
startLine: number;
|
||||
|
|
@ -286,8 +288,7 @@ export class Problem {
|
|||
}
|
||||
|
||||
export interface IDE {
|
||||
getSerializedConfig(): Promise<SerializedContinueConfig>;
|
||||
getConfigJsUrl(): Promise<string | undefined>;
|
||||
getSerializedConfig(): Promise<BrowserSerializedContinueConfig>;
|
||||
getDiff(): Promise<string>;
|
||||
getTerminalContents(): Promise<string>;
|
||||
listWorkspaceContents(directory?: string): Promise<string[]>;
|
||||
|
|
@ -452,7 +453,6 @@ export type ModelName =
|
|||
| "wizardcoder-34b"
|
||||
| "zephyr-7b"
|
||||
| "codeup-13b"
|
||||
| "deepseek-1b"
|
||||
| "deepseek-7b"
|
||||
| "deepseek-33b"
|
||||
| "neural-chat-7b"
|
||||
|
|
@ -465,7 +465,12 @@ export type ModelName =
|
|||
// Mistral
|
||||
| "mistral-tiny"
|
||||
| "mistral-small"
|
||||
| "mistral-medium";
|
||||
| "mistral-medium"
|
||||
// Tab autocomplete
|
||||
| "deepseek-1b"
|
||||
| "starcoder-1b"
|
||||
| "starcoder-3b"
|
||||
| "stable-code-3b";
|
||||
|
||||
export interface RequestOptions {
|
||||
timeout?: number;
|
||||
|
|
@ -540,8 +545,17 @@ export interface EmbeddingsProvider {
|
|||
embed(chunks: string[]): Promise<number[][]>;
|
||||
}
|
||||
|
||||
export interface TabAutocompleteOptions {
|
||||
useCopyBuffer: boolean;
|
||||
useSuffix: boolean;
|
||||
maxPromptTokens: number;
|
||||
debounceDelay: number;
|
||||
maxSuffixPercentage: number;
|
||||
prefixPercentage: number;
|
||||
template?: string;
|
||||
}
|
||||
|
||||
export interface SerializedContinueConfig {
|
||||
disallowedSteps?: string[];
|
||||
allowAnonymousTelemetry?: boolean;
|
||||
models: ModelDescription[];
|
||||
systemMessage?: string;
|
||||
|
|
@ -553,6 +567,8 @@ export interface SerializedContinueConfig {
|
|||
disableSessionTitles?: boolean;
|
||||
userToken?: string;
|
||||
embeddingsProvider?: EmbeddingsProviderDescription;
|
||||
tabAutocompleteModel?: ModelDescription;
|
||||
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
|
|
@ -581,6 +597,10 @@ export interface Config {
|
|||
userToken?: string;
|
||||
/** The provider used to calculate embeddings. If left empty, Continue will use transformers.js to calculate the embeddings with all-MiniLM-L6-v2 */
|
||||
embeddingsProvider?: EmbeddingsProviderDescription | EmbeddingsProvider;
|
||||
/** The model that Continue will use for tab autocompletions. */
|
||||
tabAutocompleteModel?: CustomLLM | ModelDescription;
|
||||
/** Options for tab autocomplete */
|
||||
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
|
||||
}
|
||||
|
||||
export interface ContinueConfig {
|
||||
|
|
@ -594,4 +614,6 @@ export interface ContinueConfig {
|
|||
disableIndexing?: boolean;
|
||||
userToken?: string;
|
||||
embeddingsProvider: EmbeddingsProvider;
|
||||
tabAutocompleteModel?: ILLM;
|
||||
tabAutocompleteOptions?: Partial<TabAutocompleteOptions>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,26 +95,27 @@ export class FullTextSearchCodebaseIndex implements CodebaseIndex {
|
|||
const db = await SqliteDb.get();
|
||||
const tagStrings = tags.map(tagToString);
|
||||
|
||||
const results = await db.all(
|
||||
`SELECT fts_metadata.chunkId, fts_metadata.path, fts.content, rank
|
||||
FROM fts
|
||||
JOIN fts_metadata ON fts.rowid = fts_metadata.id
|
||||
JOIN chunk_tags ON fts_metadata.chunkId = chunk_tags.chunkId
|
||||
WHERE fts MATCH '${text.replace(
|
||||
/\?/g,
|
||||
""
|
||||
)}' AND chunk_tags.tag IN (${tagStrings.map(() => "?").join(",")})
|
||||
${
|
||||
filterPaths
|
||||
? `AND fts_metadata.path IN (${filterPaths
|
||||
.map(() => "?")
|
||||
.join(",")})`
|
||||
: ""
|
||||
}
|
||||
ORDER BY rank
|
||||
LIMIT ?`,
|
||||
[...tagStrings, ...(filterPaths || []), n]
|
||||
);
|
||||
const query = `SELECT fts_metadata.chunkId, fts_metadata.path, fts.content, rank
|
||||
FROM fts
|
||||
JOIN fts_metadata ON fts.rowid = fts_metadata.id
|
||||
JOIN chunk_tags ON fts_metadata.chunkId = chunk_tags.chunkId
|
||||
WHERE fts MATCH '${text.replace(
|
||||
/\?/g,
|
||||
""
|
||||
)}' AND chunk_tags.tag IN (${tagStrings.map(() => "?").join(",")})
|
||||
${
|
||||
filterPaths
|
||||
? `AND fts_metadata.path IN (${filterPaths.map(() => "?").join(",")})`
|
||||
: ""
|
||||
}
|
||||
ORDER BY rank
|
||||
LIMIT ?`;
|
||||
|
||||
const results = await db.all(query, [
|
||||
...tagStrings,
|
||||
...(filterPaths || []),
|
||||
n,
|
||||
]);
|
||||
|
||||
const chunks = await db.all(
|
||||
`SELECT * FROM chunks WHERE id IN (${results.map(() => "?").join(",")})`,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import { Chunk, ChunkWithoutID } from "../..";
|
||||
import { MAX_CHUNK_SIZE } from "../../llm/constants";
|
||||
import { countTokens } from "../../llm/countTokens";
|
||||
import { supportedLanguages } from "../../util/treeSitter";
|
||||
import { basicChunker } from "./basic";
|
||||
import { codeChunker, supportedLanguages } from "./code";
|
||||
import { codeChunker } from "./code";
|
||||
|
||||
async function* chunkDocumentWithoutId(
|
||||
filepath: string,
|
||||
|
|
|
|||
|
|
@ -1,97 +1,7 @@
|
|||
// import treeSitterBash from "tree-sitter-wasms/out/tree-sitter-bash.wasm";
|
||||
// import treeSitterC from "tree-sitter-wasms/out/tree-sitter-c.wasm";
|
||||
// import treeSitterCSharp from "tree-sitter-wasms/out/tree-sitter-c_sharp.wasm";
|
||||
// import treeSitterCpp from "tree-sitter-wasms/out/tree-sitter-cpp.wasm";
|
||||
// import treeSitterCss from "tree-sitter-wasms/out/tree-sitter-css.wasm";
|
||||
// // import treeSitterElisp from "tree-sitter-wasms/out/tree-sitter-elisp.wasm"
|
||||
// // import treeSitterElixir from "tree-sitter-wasms/out/tree-sitter-elixir.wasm"
|
||||
// import treeSitterElm from "tree-sitter-wasms/out/tree-sitter-elm.wasm";
|
||||
// // import treeSitterEmbeddedTemplate from "tree-sitter-wasms/out/tree-sitter-embedded_template.wasm"
|
||||
// import treeSitterGo from "tree-sitter-wasms/out/tree-sitter-go.wasm";
|
||||
// import treeSitterHtml from "tree-sitter-wasms/out/tree-sitter-html.wasm";
|
||||
// import treeSitterJava from "tree-sitter-wasms/out/tree-sitter-java.wasm";
|
||||
// import treeSitterJavascript from "tree-sitter-wasms/out/tree-sitter-javascript.wasm";
|
||||
// import treeSitterJson from "tree-sitter-wasms/out/tree-sitter-json.wasm";
|
||||
// // import treeSitterLua from "tree-sitter-wasms/out/tree-sitter-lua.wasm"
|
||||
// import treeSitterOcaml from "tree-sitter-wasms/out/tree-sitter-ocaml.wasm";
|
||||
// import treeSitterPhp from "tree-sitter-wasms/out/tree-sitter-php.wasm";
|
||||
// import treeSitterPython from "tree-sitter-wasms/out/tree-sitter-python.wasm";
|
||||
// // import treeSitterQl from "tree-sitter-wasms/out/tree-sitter-ql.wasm"
|
||||
// // import treeSitterRescript from "tree-sitter-wasms/out/tree-sitter-rescript.wasm"
|
||||
// import treeSitterRuby from "tree-sitter-wasms/out/tree-sitter-ruby.wasm";
|
||||
// import treeSitterRust from "tree-sitter-wasms/out/tree-sitter-rust.wasm";
|
||||
// // import treeSitterSystemRdl from "tree-sitter-wasms/out/tree-sitter-systemrdl.wasm"
|
||||
// import treeSitterToml from "tree-sitter-wasms/out/tree-sitter-toml.wasm";
|
||||
// import treeSitterTsx from "tree-sitter-wasms/out/tree-sitter-tsx.wasm";
|
||||
// import treeSitterTypescript from "tree-sitter-wasms/out/tree-sitter-typescript.wasm";
|
||||
// import treeSitterVue from "tree-sitter-wasms/out/tree-sitter-vue.wasm";
|
||||
// import treeSitterYaml from "tree-sitter-wasms/out/tree-sitter-yaml.wasm";
|
||||
|
||||
import Parser, { SyntaxNode } from "web-tree-sitter";
|
||||
import { SyntaxNode } from "web-tree-sitter";
|
||||
import { ChunkWithoutID } from "../..";
|
||||
import { countTokens } from "../../llm/countTokens";
|
||||
|
||||
// export const fileExtensionToWasm: { [key: string]: string } = {
|
||||
// py: treeSitterPython,
|
||||
// js: treeSitterJavascript,
|
||||
// html: treeSitterHtml,
|
||||
// java: treeSitterJava,
|
||||
// go: treeSitterGo,
|
||||
// rb: treeSitterRuby,
|
||||
// rs: treeSitterRust,
|
||||
// c: treeSitterC,
|
||||
// cpp: treeSitterCpp,
|
||||
// cs: treeSitterCSharp,
|
||||
// php: treeSitterPhp,
|
||||
// css: treeSitterCss,
|
||||
// bash: treeSitterBash,
|
||||
// json: treeSitterJson,
|
||||
// ts: treeSitterTypescript,
|
||||
// tsx: treeSitterTsx,
|
||||
// vue: treeSitterVue,
|
||||
// yaml: treeSitterYaml,
|
||||
// toml: treeSitterToml,
|
||||
// ocaml: treeSitterOcaml,
|
||||
// elm: treeSitterElm,
|
||||
// // jl: treeSitterJulia,
|
||||
// // swift: "swift",
|
||||
// // kt: "kotlin",
|
||||
// // scala: treeSitterScala,
|
||||
// };
|
||||
|
||||
export const supportedLanguages: { [key: string]: string } = {
|
||||
cpp: "cpp",
|
||||
cs: "csharp",
|
||||
php: "php",
|
||||
css: "css",
|
||||
bash: "bash",
|
||||
json: "json",
|
||||
ts: "typescript",
|
||||
tsx: "tsx",
|
||||
vue: "vue",
|
||||
yaml: "yaml",
|
||||
toml: "toml",
|
||||
ocaml: "ocaml",
|
||||
elm: "elm",
|
||||
rb: "ruby",
|
||||
js: "javascript",
|
||||
// jl: "julia",
|
||||
// swift: "swift",
|
||||
// kt: "kotlin",
|
||||
// scala: "scala",
|
||||
};
|
||||
|
||||
async function getParserForFile(filepath: string) {
|
||||
await Parser.init();
|
||||
const parser = new Parser();
|
||||
const segs = filepath.split(".");
|
||||
const wasmPath = `${__dirname}/tree-sitter-wasms/tree-sitter-${
|
||||
supportedLanguages[segs[segs.length - 1]]
|
||||
}.wasm`;
|
||||
const Language = await Parser.Language.load(wasmPath);
|
||||
parser.setLanguage(Language);
|
||||
return parser;
|
||||
}
|
||||
import { getParserForFile } from "../../util/treeSitter";
|
||||
|
||||
function collapsedReplacement(node: SyntaxNode): string {
|
||||
if (node.type === "statement_block") {
|
||||
|
|
@ -292,11 +202,10 @@ export async function* codeChunker(
|
|||
if (contents.trim().length === 0) {
|
||||
return;
|
||||
}
|
||||
let parser: Parser;
|
||||
try {
|
||||
parser = await getParserForFile(filepath);
|
||||
} catch (e) {
|
||||
console.warn(`Failed to load parser for file ${filepath}: `, e);
|
||||
|
||||
let parser = await getParserForFile(filepath);
|
||||
if (parser === undefined) {
|
||||
console.warn(`Failed to load parser for file ${filepath}: `);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import crypto from "crypto";
|
||||
import * as fs from "fs";
|
||||
import { Database, open } from "sqlite";
|
||||
import sqlite3 from "sqlite3";
|
||||
import { IndexingProgressUpdate } from "..";
|
||||
|
|
@ -46,13 +47,16 @@ export class SqliteDb {
|
|||
);
|
||||
}
|
||||
|
||||
private static indexSqlitePath = getIndexSqlitePath();
|
||||
|
||||
static async get() {
|
||||
if (SqliteDb.db) {
|
||||
if (SqliteDb.db && fs.existsSync(SqliteDb.indexSqlitePath)) {
|
||||
return SqliteDb.db;
|
||||
}
|
||||
|
||||
SqliteDb.indexSqlitePath = getIndexSqlitePath();
|
||||
SqliteDb.db = await open({
|
||||
filename: getIndexSqlitePath(),
|
||||
filename: SqliteDb.indexSqlitePath,
|
||||
driver: sqlite3.Database,
|
||||
});
|
||||
|
||||
|
|
|
|||
256
core/llm/autodetect.ts
Normal file
256
core/llm/autodetect.ts
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
import { ModelProvider, TemplateType } from "..";
|
||||
import {
|
||||
anthropicTemplateMessages,
|
||||
chatmlTemplateMessages,
|
||||
codeLlama70bTemplateMessages,
|
||||
deepseekTemplateMessages,
|
||||
llama2TemplateMessages,
|
||||
llavaTemplateMessages,
|
||||
neuralChatTemplateMessages,
|
||||
openchatTemplateMessages,
|
||||
phi2TemplateMessages,
|
||||
phindTemplateMessages,
|
||||
templateAlpacaMessages,
|
||||
xWinCoderTemplateMessages,
|
||||
zephyrTemplateMessages,
|
||||
} from "./templates/chat";
|
||||
import {
|
||||
alpacaEditPrompt,
|
||||
codeLlama70bEditPrompt,
|
||||
codellamaEditPrompt,
|
||||
deepseekEditPrompt,
|
||||
mistralEditPrompt,
|
||||
neuralChatEditPrompt,
|
||||
openchatEditPrompt,
|
||||
phindEditPrompt,
|
||||
simplestEditPrompt,
|
||||
simplifiedEditPrompt,
|
||||
xWinCoderEditPrompt,
|
||||
zephyrEditPrompt,
|
||||
} from "./templates/edit";
|
||||
|
||||
const PROVIDER_HANDLES_TEMPLATING: ModelProvider[] = [
|
||||
"lmstudio",
|
||||
"openai",
|
||||
"ollama",
|
||||
"together",
|
||||
];
|
||||
|
||||
const PROVIDER_SUPPORTS_IMAGES: ModelProvider[] = [
|
||||
"openai",
|
||||
"ollama",
|
||||
"google-palm",
|
||||
"free-trial",
|
||||
];
|
||||
|
||||
function modelSupportsImages(provider: ModelProvider, model: string): boolean {
|
||||
if (!PROVIDER_SUPPORTS_IMAGES.includes(provider)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (model.includes("llava")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (["gpt-4-vision-preview"].includes(model)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
model === "gemini-ultra" &&
|
||||
(provider === "google-palm" || provider === "free-trial")
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
const PARALLEL_PROVIDERS: ModelProvider[] = [
|
||||
"anthropic",
|
||||
"bedrock",
|
||||
"deepinfra",
|
||||
"gemini",
|
||||
"google-palm",
|
||||
"huggingface-inference-api",
|
||||
"huggingface-tgi",
|
||||
"mistral",
|
||||
"free-trial",
|
||||
"replicate",
|
||||
"together",
|
||||
];
|
||||
|
||||
function llmCanGenerateInParallel(
|
||||
provider: ModelProvider,
|
||||
model: string
|
||||
): boolean {
|
||||
if (provider === "openai") {
|
||||
return model.includes("gpt");
|
||||
}
|
||||
|
||||
return PARALLEL_PROVIDERS.includes(provider);
|
||||
}
|
||||
|
||||
function autodetectTemplateType(model: string): TemplateType | undefined {
|
||||
const lower = model.toLowerCase();
|
||||
|
||||
if (lower.includes("codellama") && lower.includes("70b")) {
|
||||
return "codellama-70b";
|
||||
}
|
||||
|
||||
if (
|
||||
lower.includes("gpt") ||
|
||||
lower.includes("chat-bison") ||
|
||||
lower.includes("pplx") ||
|
||||
lower.includes("gemini")
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (lower.includes("llava")) {
|
||||
return "llava";
|
||||
}
|
||||
|
||||
if (lower.includes("tinyllama")) {
|
||||
return "zephyr";
|
||||
}
|
||||
|
||||
if (lower.includes("xwin")) {
|
||||
return "xwin-coder";
|
||||
}
|
||||
|
||||
if (lower.includes("dolphin")) {
|
||||
return "chatml";
|
||||
}
|
||||
|
||||
if (lower.includes("phi2")) {
|
||||
return "phi2";
|
||||
}
|
||||
|
||||
if (lower.includes("phind")) {
|
||||
return "phind";
|
||||
}
|
||||
|
||||
if (lower.includes("llama")) {
|
||||
return "llama2";
|
||||
}
|
||||
|
||||
if (lower.includes("zephyr")) {
|
||||
return "zephyr";
|
||||
}
|
||||
|
||||
if (lower.includes("claude")) {
|
||||
return "anthropic";
|
||||
}
|
||||
|
||||
if (lower.includes("alpaca") || lower.includes("wizard")) {
|
||||
return "alpaca";
|
||||
}
|
||||
|
||||
if (lower.includes("mistral")) {
|
||||
return "llama2";
|
||||
}
|
||||
|
||||
if (lower.includes("deepseek")) {
|
||||
return "deepseek";
|
||||
}
|
||||
|
||||
if (lower.includes("ninja") || lower.includes("openchat")) {
|
||||
return "openchat";
|
||||
}
|
||||
|
||||
if (lower.includes("neural-chat")) {
|
||||
return "neural-chat";
|
||||
}
|
||||
|
||||
return "chatml";
|
||||
}
|
||||
|
||||
function autodetectTemplateFunction(
|
||||
model: string,
|
||||
provider: ModelProvider,
|
||||
explicitTemplate: TemplateType | undefined = undefined
|
||||
) {
|
||||
if (
|
||||
explicitTemplate === undefined &&
|
||||
PROVIDER_HANDLES_TEMPLATING.includes(provider)
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const templateType = explicitTemplate || autodetectTemplateType(model);
|
||||
|
||||
if (templateType) {
|
||||
const mapping: Record<TemplateType, any> = {
|
||||
llama2: llama2TemplateMessages,
|
||||
alpaca: templateAlpacaMessages,
|
||||
phi2: phi2TemplateMessages,
|
||||
phind: phindTemplateMessages,
|
||||
zephyr: zephyrTemplateMessages,
|
||||
anthropic: anthropicTemplateMessages,
|
||||
chatml: chatmlTemplateMessages,
|
||||
deepseek: deepseekTemplateMessages,
|
||||
openchat: openchatTemplateMessages,
|
||||
"xwin-coder": xWinCoderTemplateMessages,
|
||||
"neural-chat": neuralChatTemplateMessages,
|
||||
llava: llavaTemplateMessages,
|
||||
"codellama-70b": codeLlama70bTemplateMessages,
|
||||
none: null,
|
||||
};
|
||||
|
||||
return mapping[templateType];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function autodetectPromptTemplates(
|
||||
model: string,
|
||||
explicitTemplate: TemplateType | undefined = undefined
|
||||
) {
|
||||
const templateType = explicitTemplate || autodetectTemplateType(model);
|
||||
const templates: Record<string, any> = {};
|
||||
|
||||
let editTemplate = null;
|
||||
|
||||
if (templateType === "phind") {
|
||||
editTemplate = phindEditPrompt;
|
||||
} else if (templateType === "phi2") {
|
||||
editTemplate = simplifiedEditPrompt;
|
||||
} else if (templateType === "zephyr") {
|
||||
editTemplate = zephyrEditPrompt;
|
||||
} else if (templateType === "llama2") {
|
||||
if (model.includes("mistral")) {
|
||||
editTemplate = mistralEditPrompt;
|
||||
} else {
|
||||
editTemplate = codellamaEditPrompt;
|
||||
}
|
||||
} else if (templateType === "alpaca") {
|
||||
editTemplate = alpacaEditPrompt;
|
||||
} else if (templateType === "deepseek") {
|
||||
editTemplate = deepseekEditPrompt;
|
||||
} else if (templateType === "openchat") {
|
||||
editTemplate = openchatEditPrompt;
|
||||
} else if (templateType === "xwin-coder") {
|
||||
editTemplate = xWinCoderEditPrompt;
|
||||
} else if (templateType === "neural-chat") {
|
||||
editTemplate = neuralChatEditPrompt;
|
||||
} else if (templateType === "codellama-70b") {
|
||||
editTemplate = codeLlama70bEditPrompt;
|
||||
} else if (templateType) {
|
||||
editTemplate = simplestEditPrompt;
|
||||
}
|
||||
|
||||
if (editTemplate !== null) {
|
||||
templates["edit"] = editTemplate;
|
||||
}
|
||||
|
||||
return templates;
|
||||
}
|
||||
|
||||
export {
|
||||
autodetectPromptTemplates,
|
||||
autodetectTemplateFunction,
|
||||
autodetectTemplateType,
|
||||
llmCanGenerateInParallel,
|
||||
modelSupportsImages,
|
||||
};
|
||||
|
|
@ -72,6 +72,26 @@ function countChatMessageTokens(
|
|||
return countTokens(chatMessage.content, modelName) + TOKENS_PER_MESSAGE;
|
||||
}
|
||||
|
||||
function pruneLinesFromTop(prompt: string, maxTokens: number): string {
|
||||
let totalTokens = countTokens(prompt, "gpt-4");
|
||||
const lines = prompt.split("\n");
|
||||
while (totalTokens > maxTokens && lines.length > 0) {
|
||||
totalTokens -= countTokens(lines.shift()!, "gpt-4");
|
||||
}
|
||||
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
function pruneLinesFromBottom(prompt: string, maxTokens: number): string {
|
||||
let totalTokens = countTokens(prompt, "gpt-4");
|
||||
const lines = prompt.split("\n");
|
||||
while (totalTokens > maxTokens && lines.length > 0) {
|
||||
totalTokens -= countTokens(lines.pop()!, "gpt-4");
|
||||
}
|
||||
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
function pruneStringFromBottom(
|
||||
modelName: string,
|
||||
maxTokens: number,
|
||||
|
|
@ -307,6 +327,9 @@ function compileChatMessages(
|
|||
export {
|
||||
compileChatMessages,
|
||||
countTokens,
|
||||
pruneLinesFromBottom,
|
||||
pruneLinesFromTop,
|
||||
pruneRawPromptFromTop,
|
||||
pruneStringFromBottom,
|
||||
pruneStringFromTop,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,8 +11,13 @@ import {
|
|||
RequestOptions,
|
||||
TemplateType,
|
||||
} from "..";
|
||||
import { ideRequest, ideStreamRequest } from "../ide/messaging";
|
||||
import mergeJson from "../util/merge";
|
||||
import {
|
||||
autodetectPromptTemplates,
|
||||
autodetectTemplateFunction,
|
||||
autodetectTemplateType,
|
||||
modelSupportsImages,
|
||||
} from "./autodetect";
|
||||
import {
|
||||
CONTEXT_LENGTH_FOR_MODEL,
|
||||
DEFAULT_ARGS,
|
||||
|
|
@ -24,251 +29,8 @@ import {
|
|||
countTokens,
|
||||
pruneRawPromptFromTop,
|
||||
} from "./countTokens";
|
||||
import {
|
||||
anthropicTemplateMessages,
|
||||
chatmlTemplateMessages,
|
||||
codeLlama70bTemplateMessages,
|
||||
deepseekTemplateMessages,
|
||||
llama2TemplateMessages,
|
||||
llavaTemplateMessages,
|
||||
neuralChatTemplateMessages,
|
||||
openchatTemplateMessages,
|
||||
phi2TemplateMessages,
|
||||
phindTemplateMessages,
|
||||
templateAlpacaMessages,
|
||||
xWinCoderTemplateMessages,
|
||||
zephyrTemplateMessages,
|
||||
} from "./templates/chat";
|
||||
import {
|
||||
alpacaEditPrompt,
|
||||
codeLlama70bEditPrompt,
|
||||
codellamaEditPrompt,
|
||||
deepseekEditPrompt,
|
||||
mistralEditPrompt,
|
||||
neuralChatEditPrompt,
|
||||
openchatEditPrompt,
|
||||
phindEditPrompt,
|
||||
simplestEditPrompt,
|
||||
simplifiedEditPrompt,
|
||||
xWinCoderEditPrompt,
|
||||
zephyrEditPrompt,
|
||||
} from "./templates/edit";
|
||||
import CompletionOptionsForModels from "./templates/options";
|
||||
|
||||
const PROVIDER_HANDLES_TEMPLATING: ModelProvider[] = [
|
||||
"lmstudio",
|
||||
"openai",
|
||||
"ollama",
|
||||
"together",
|
||||
];
|
||||
|
||||
const PROVIDER_SUPPORTS_IMAGES: ModelProvider[] = [
|
||||
"openai",
|
||||
"ollama",
|
||||
"google-palm",
|
||||
"free-trial",
|
||||
];
|
||||
|
||||
export function modelSupportsImages(
|
||||
provider: ModelProvider,
|
||||
model: string
|
||||
): boolean {
|
||||
if (!PROVIDER_SUPPORTS_IMAGES.includes(provider)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (model.includes("llava")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (["gpt-4-vision-preview"].includes(model)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
model === "gemini-ultra" &&
|
||||
(provider === "google-palm" || provider === "free-trial")
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
const PARALLEL_PROVIDERS: ModelProvider[] = [
|
||||
"anthropic",
|
||||
"bedrock",
|
||||
"deepinfra",
|
||||
"gemini",
|
||||
"google-palm",
|
||||
"huggingface-inference-api",
|
||||
"huggingface-tgi",
|
||||
"mistral",
|
||||
"free-trial",
|
||||
"replicate",
|
||||
"together",
|
||||
];
|
||||
|
||||
export function llmCanGenerateInParallel(llm: ILLM): boolean {
|
||||
if (llm.providerName === "openai") {
|
||||
return llm.model.includes("gpt");
|
||||
}
|
||||
|
||||
return PARALLEL_PROVIDERS.includes(llm.providerName);
|
||||
}
|
||||
|
||||
function autodetectTemplateType(model: string): TemplateType | undefined {
|
||||
const lower = model.toLowerCase();
|
||||
|
||||
if (lower.includes("codellama") && lower.includes("70b")) {
|
||||
return "codellama-70b";
|
||||
}
|
||||
|
||||
if (
|
||||
lower.includes("gpt") ||
|
||||
lower.includes("chat-bison") ||
|
||||
lower.includes("pplx") ||
|
||||
lower.includes("gemini")
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (lower.includes("llava")) {
|
||||
return "llava";
|
||||
}
|
||||
|
||||
if (lower.includes("xwin")) {
|
||||
return "xwin-coder";
|
||||
}
|
||||
|
||||
if (lower.includes("dolphin")) {
|
||||
return "chatml";
|
||||
}
|
||||
|
||||
if (lower.includes("phi2")) {
|
||||
return "phi2";
|
||||
}
|
||||
|
||||
if (lower.includes("phind")) {
|
||||
return "phind";
|
||||
}
|
||||
|
||||
if (lower.includes("llama")) {
|
||||
return "llama2";
|
||||
}
|
||||
|
||||
if (lower.includes("zephyr")) {
|
||||
return "zephyr";
|
||||
}
|
||||
|
||||
if (lower.includes("claude")) {
|
||||
return "anthropic";
|
||||
}
|
||||
|
||||
if (lower.includes("alpaca") || lower.includes("wizard")) {
|
||||
return "alpaca";
|
||||
}
|
||||
|
||||
if (lower.includes("mistral")) {
|
||||
return "llama2";
|
||||
}
|
||||
|
||||
if (lower.includes("deepseek")) {
|
||||
return "deepseek";
|
||||
}
|
||||
|
||||
if (lower.includes("ninja") || lower.includes("openchat")) {
|
||||
return "openchat";
|
||||
}
|
||||
|
||||
if (lower.includes("neural-chat")) {
|
||||
return "neural-chat";
|
||||
}
|
||||
|
||||
return "chatml";
|
||||
}
|
||||
|
||||
function autodetectTemplateFunction(
|
||||
model: string,
|
||||
provider: ModelProvider,
|
||||
explicitTemplate: TemplateType | undefined = undefined
|
||||
) {
|
||||
if (
|
||||
explicitTemplate === undefined &&
|
||||
PROVIDER_HANDLES_TEMPLATING.includes(provider)
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const templateType = explicitTemplate || autodetectTemplateType(model);
|
||||
|
||||
if (templateType) {
|
||||
const mapping: Record<TemplateType, any> = {
|
||||
llama2: llama2TemplateMessages,
|
||||
alpaca: templateAlpacaMessages,
|
||||
phi2: phi2TemplateMessages,
|
||||
phind: phindTemplateMessages,
|
||||
zephyr: zephyrTemplateMessages,
|
||||
anthropic: anthropicTemplateMessages,
|
||||
chatml: chatmlTemplateMessages,
|
||||
deepseek: deepseekTemplateMessages,
|
||||
openchat: openchatTemplateMessages,
|
||||
"xwin-coder": xWinCoderTemplateMessages,
|
||||
"neural-chat": neuralChatTemplateMessages,
|
||||
llava: llavaTemplateMessages,
|
||||
"codellama-70b": codeLlama70bTemplateMessages,
|
||||
none: null,
|
||||
};
|
||||
|
||||
return mapping[templateType];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function autodetectPromptTemplates(
|
||||
model: string,
|
||||
explicitTemplate: TemplateType | undefined = undefined
|
||||
) {
|
||||
const templateType = explicitTemplate || autodetectTemplateType(model);
|
||||
const templates: Record<string, any> = {};
|
||||
|
||||
let editTemplate = null;
|
||||
|
||||
if (templateType === "phind") {
|
||||
editTemplate = phindEditPrompt;
|
||||
} else if (templateType === "phi2") {
|
||||
editTemplate = simplifiedEditPrompt;
|
||||
} else if (templateType === "zephyr") {
|
||||
editTemplate = zephyrEditPrompt;
|
||||
} else if (templateType === "llama2") {
|
||||
if (model.includes("mistral")) {
|
||||
editTemplate = mistralEditPrompt;
|
||||
} else {
|
||||
editTemplate = codellamaEditPrompt;
|
||||
}
|
||||
} else if (templateType === "alpaca") {
|
||||
editTemplate = alpacaEditPrompt;
|
||||
} else if (templateType === "deepseek") {
|
||||
editTemplate = deepseekEditPrompt;
|
||||
} else if (templateType === "openchat") {
|
||||
editTemplate = openchatEditPrompt;
|
||||
} else if (templateType === "xwin-coder") {
|
||||
editTemplate = xWinCoderEditPrompt;
|
||||
} else if (templateType === "neural-chat") {
|
||||
editTemplate = neuralChatEditPrompt;
|
||||
} else if (templateType === "codellama-70b") {
|
||||
editTemplate = codeLlama70bEditPrompt;
|
||||
} else if (templateType) {
|
||||
editTemplate = simplestEditPrompt;
|
||||
}
|
||||
|
||||
if (editTemplate !== null) {
|
||||
templates["edit"] = editTemplate;
|
||||
}
|
||||
|
||||
return templates;
|
||||
}
|
||||
|
||||
export abstract class BaseLLM implements ILLM {
|
||||
static providerName: ModelProvider;
|
||||
static defaultOptions: Partial<LLMOptions> | undefined = undefined;
|
||||
|
|
@ -485,25 +247,6 @@ ${prompt}`;
|
|||
prompt: string,
|
||||
options: LLMFullCompletionOptions = {}
|
||||
) {
|
||||
if (!this._shouldRequestDirectly()) {
|
||||
const gen = ideStreamRequest("llmStreamComplete", {
|
||||
prompt,
|
||||
title: this.title,
|
||||
completionOptions: options,
|
||||
});
|
||||
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
yield next.value;
|
||||
next = await gen.next();
|
||||
}
|
||||
|
||||
return {
|
||||
prompt: next.value?.prompt,
|
||||
completion: next.value?.completion,
|
||||
};
|
||||
}
|
||||
|
||||
const { completionOptions, log, raw } =
|
||||
this._parseCompletionOptions(options);
|
||||
|
||||
|
|
@ -543,16 +286,6 @@ ${prompt}`;
|
|||
}
|
||||
|
||||
async complete(prompt: string, options: LLMFullCompletionOptions = {}) {
|
||||
if (!this._shouldRequestDirectly()) {
|
||||
return (
|
||||
await ideRequest("llmComplete", {
|
||||
prompt,
|
||||
title: this.title,
|
||||
completionOptions: options,
|
||||
})
|
||||
).content;
|
||||
}
|
||||
|
||||
const { completionOptions, log, raw } =
|
||||
this._parseCompletionOptions(options);
|
||||
|
||||
|
|
@ -598,20 +331,6 @@ ${prompt}`;
|
|||
messages: ChatMessage[],
|
||||
options: LLMFullCompletionOptions = {}
|
||||
): AsyncGenerator<ChatMessage, LLMReturnValue> {
|
||||
if (!this._shouldRequestDirectly()) {
|
||||
const gen = ideStreamRequest("llmStreamChat", {
|
||||
messages,
|
||||
title: this.title,
|
||||
completionOptions: options,
|
||||
});
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
yield { role: "user", content: next.value };
|
||||
next = await gen.next();
|
||||
}
|
||||
return { prompt: next.value?.prompt, completion: next.value?.completion };
|
||||
}
|
||||
|
||||
const { completionOptions, log, raw } =
|
||||
this._parseCompletionOptions(options);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class FreeTrial extends BaseLLM {
|
|||
frequency_penalty: options.frequencyPenalty,
|
||||
presence_penalty: options.presencePenalty,
|
||||
max_tokens: options.maxTokens,
|
||||
stop: options.stop,
|
||||
stop: options.stop?.slice(0, 4),
|
||||
temperature: options.temperature,
|
||||
top_p: options.topP,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -79,6 +79,9 @@ class Ollama extends BaseLLM {
|
|||
"deepseek-7b": "deepseek-coder:6.7b",
|
||||
"deepseek-33b": "deepseek-coder:33b",
|
||||
"neural-chat-7b": "neural-chat:7b-v3.3",
|
||||
"starcoder-1b": "starcoder:1b",
|
||||
"starcoder-3b": "starcoder:3b",
|
||||
"stable-code-3b": "stable-code:3b",
|
||||
}[this.model] || this.model
|
||||
);
|
||||
}
|
||||
|
|
@ -204,6 +207,14 @@ class Ollama extends BaseLLM {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
async listModels(): Promise<string[]> {
|
||||
const response = await this.fetch(`${this.apiBase}/api/tags`, {
|
||||
method: "GET",
|
||||
});
|
||||
const data = await response.json();
|
||||
return data.models.map((model: any) => model.name);
|
||||
}
|
||||
}
|
||||
|
||||
export default Ollama;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class OpenAI extends BaseLLM {
|
|||
top_p: options.topP,
|
||||
frequency_penalty: options.frequencyPenalty,
|
||||
presence_penalty: options.presencePenalty,
|
||||
stop: options.stop,
|
||||
stop: options.stop?.slice(0, 4),
|
||||
};
|
||||
|
||||
return finalOptions;
|
||||
|
|
|
|||
|
|
@ -26,10 +26,13 @@ class Replicate extends BaseLLM {
|
|||
"nateraw/zephyr-7b-beta:b79f33de5c6c4e34087d44eaea4a9d98ce5d3f3a09522f7328eea0685003a931",
|
||||
"mistral-7b":
|
||||
"mistralai/mistral-7b-instruct-v0.1:83b6a56e7c828e667f21fd596c338fd4f0039b46bcfa18d973e8e70e455fda70",
|
||||
"mistral-8x7b": "mistralai/mixtral-8x7b-instruct-v0.1" as any,
|
||||
"wizardcoder-34b":
|
||||
"andreasjansson/wizardcoder-python-34b-v1-gguf:67eed332a5389263b8ede41be3ee7dc119fa984e2bde287814c4abed19a45e54",
|
||||
"neural-chat-7b":
|
||||
"tomasmcm/neural-chat-7b-v3-1:acb450496b49e19a1e410b50c574a34acacd54820bc36c19cbfe05148de2ba57",
|
||||
"deepseek-7b": "kcaverly/deepseek-coder-33b-instruct-gguf" as any,
|
||||
"phind-codellama-34b": "kcaverly/phind-codellama-34b-v2-gguf" as any,
|
||||
};
|
||||
|
||||
static providerName: ModelProvider = "replicate";
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class Together extends OpenAI {
|
|||
"mistral-7b": "mistralai/Mistral-7B-Instruct-v0.1",
|
||||
"mistral-8x7b": "mistralai/Mixtral-8x7B-Instruct-v0.1",
|
||||
"phind-codellama-34b": "Phind/Phind-CodeLlama-34B-v2",
|
||||
"wizardcoder-34b": "WizardLM/WizardCoder-Python-34B-V1.0",
|
||||
};
|
||||
|
||||
private _getModelName(model: string) {
|
||||
|
|
|
|||
|
|
@ -9,20 +9,12 @@ export async function* streamResponse(
|
|||
throw new Error(`No response body returned.`);
|
||||
}
|
||||
|
||||
const stream = response.body;
|
||||
const stream = response.body as any;
|
||||
|
||||
const reader = stream.getReader();
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (value) {
|
||||
// @ts-ignore
|
||||
yield decoder.decode(value);
|
||||
}
|
||||
for await (const chunk of stream) {
|
||||
yield decoder.decode(chunk);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
193
core/package-lock.json
generated
193
core/package-lock.json
generated
|
|
@ -10,12 +10,15 @@
|
|||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@types/node-fetch": "^2.6.11",
|
||||
"@xenova/transformers": "^2.14.0",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"dotenv": "^16.3.1",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
"handlebars": "^4.7.8",
|
||||
"js-tiktoken": "^1.0.8",
|
||||
"llm-code-highlighter": "^0.0.3",
|
||||
"node-fetch": "^3.3.2",
|
||||
"node-html-markdown": "^1.3.0",
|
||||
"openai": "^4.20.1",
|
||||
"replicate": "^0.23.0",
|
||||
|
|
@ -2002,6 +2005,11 @@
|
|||
"onnxruntime-node": "1.14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@yomguithereal/helpers": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@yomguithereal/helpers/-/helpers-1.1.1.tgz",
|
||||
"integrity": "sha512-UYvAq/XCA7xoh1juWDYsq3W0WywOB+pz8cgVnE1b45ZfdMhBvHDrgmSFG3jXeZSr2tMTYLGHFHON+ekG05Jebg=="
|
||||
},
|
||||
"node_modules/abbrev": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
|
|
@ -2884,6 +2892,14 @@
|
|||
"url": "https://github.com/sponsors/fb55"
|
||||
}
|
||||
},
|
||||
"node_modules/data-uri-to-buffer": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
|
||||
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
|
|
@ -3234,6 +3250,14 @@
|
|||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/events": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
|
||||
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
|
||||
"engines": {
|
||||
"node": ">=0.8.x"
|
||||
}
|
||||
},
|
||||
"node_modules/execa": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
|
||||
|
|
@ -3318,6 +3342,28 @@
|
|||
"bser": "2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/fetch-blob": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
|
||||
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jimmywarting"
|
||||
},
|
||||
{
|
||||
"type": "paypal",
|
||||
"url": "https://paypal.me/jimmywarting"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"node-domexception": "^1.0.0",
|
||||
"web-streams-polyfill": "^3.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20 || >= 14.13"
|
||||
}
|
||||
},
|
||||
"node_modules/file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
|
|
@ -3421,6 +3467,17 @@
|
|||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/formdata-polyfill": {
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
|
||||
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
|
||||
"dependencies": {
|
||||
"fetch-blob": "^3.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-constants": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
||||
|
|
@ -3564,6 +3621,71 @@
|
|||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
||||
"devOptional": true
|
||||
},
|
||||
"node_modules/graphology": {
|
||||
"version": "0.25.4",
|
||||
"resolved": "https://registry.npmjs.org/graphology/-/graphology-0.25.4.tgz",
|
||||
"integrity": "sha512-33g0Ol9nkWdD6ulw687viS8YJQBxqG5LWII6FI6nul0pq6iM2t5EKquOTFDbyTblRB3O9I+7KX4xI8u5ffekAQ==",
|
||||
"dependencies": {
|
||||
"events": "^3.3.0",
|
||||
"obliterator": "^2.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"graphology-types": ">=0.24.0"
|
||||
}
|
||||
},
|
||||
"node_modules/graphology-indices": {
|
||||
"version": "0.17.0",
|
||||
"resolved": "https://registry.npmjs.org/graphology-indices/-/graphology-indices-0.17.0.tgz",
|
||||
"integrity": "sha512-A7RXuKQvdqSWOpn7ZVQo4S33O0vCfPBnUSf7FwE0zNCasqwZVUaCXePuWo5HBpWw68KJcwObZDHpFk6HKH6MYQ==",
|
||||
"dependencies": {
|
||||
"graphology-utils": "^2.4.2",
|
||||
"mnemonist": "^0.39.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"graphology-types": ">=0.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/graphology-metrics": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/graphology-metrics/-/graphology-metrics-2.2.0.tgz",
|
||||
"integrity": "sha512-eZZFRLGGyyI+iD+XwQvc+lLM3EKCoqUvVjvF/14Htgy4grB2m95OytToYq3saWuHfuf22VVnj9GBHv/pTzKuTw==",
|
||||
"dependencies": {
|
||||
"graphology-shortest-path": "^2.0.0",
|
||||
"graphology-utils": "^2.4.4",
|
||||
"mnemonist": "^0.39.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"graphology-types": ">=0.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/graphology-shortest-path": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/graphology-shortest-path/-/graphology-shortest-path-2.0.2.tgz",
|
||||
"integrity": "sha512-hlGvh4Yb1Vmd2J7wT8Q8+t4RQ6Tx+9wRYm0/fZB9PZJ4uW3nml5kJ7yXZ2+JYWT+7wLLmY5mg3o9bLSAWmv/jQ==",
|
||||
"dependencies": {
|
||||
"@yomguithereal/helpers": "^1.1.1",
|
||||
"graphology-indices": "^0.17.0",
|
||||
"graphology-utils": "^2.4.3",
|
||||
"mnemonist": "^0.39.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"graphology-types": ">=0.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/graphology-types": {
|
||||
"version": "0.24.7",
|
||||
"resolved": "https://registry.npmjs.org/graphology-types/-/graphology-types-0.24.7.tgz",
|
||||
"integrity": "sha512-tdcqOOpwArNjEr0gNQKCXwaNCWnQJrog14nJNQPeemcLnXQUUGrsCWpWkVKt46zLjcS6/KGoayeJfHHyPDlvwA==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/graphology-utils": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/graphology-utils/-/graphology-utils-2.5.2.tgz",
|
||||
"integrity": "sha512-ckHg8MXrXJkOARk56ZaSCM1g1Wihe2d6iTmz1enGOz4W/l831MBCKSayeFQfowgF8wd+PQ4rlch/56Vs/VZLDQ==",
|
||||
"peerDependencies": {
|
||||
"graphology-types": ">=0.23.0"
|
||||
}
|
||||
},
|
||||
"node_modules/guid-typescript": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz",
|
||||
|
|
@ -4647,6 +4769,18 @@
|
|||
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/llm-code-highlighter": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/llm-code-highlighter/-/llm-code-highlighter-0.0.3.tgz",
|
||||
"integrity": "sha512-l/R+m6ngXRTYxzoCzqpBk5TiSVpS4Ek9fKx/PIy25HV6XDbCC6iOfVITPPSTGkh7NlI+tN5vWjdqUfN3YW+HwQ==",
|
||||
"dependencies": {
|
||||
"graphology": "^0.25.4",
|
||||
"graphology-metrics": "^2.2.0",
|
||||
"lodash": "^4.17.21",
|
||||
"tree-sitter-wasms": "^0.1.6",
|
||||
"web-tree-sitter": "^0.20.8"
|
||||
}
|
||||
},
|
||||
"node_modules/locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||
|
|
@ -4659,6 +4793,11 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
},
|
||||
"node_modules/lodash.assignwith": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz",
|
||||
|
|
@ -4999,6 +5138,14 @@
|
|||
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
||||
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
|
||||
},
|
||||
"node_modules/mnemonist": {
|
||||
"version": "0.39.7",
|
||||
"resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.39.7.tgz",
|
||||
"integrity": "sha512-ix3FwHWZgdXUt0dHM8bCrI4r1KMeYx8bCunPCYmvKXq4tn6gbNsqrsb4q0kDbDqbpIOvEaW5Sn+dmDwGydfrwA==",
|
||||
"dependencies": {
|
||||
"obliterator": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
|
|
@ -5094,22 +5241,20 @@
|
|||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
|
||||
"integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
"data-uri-to-buffer": "^4.0.0",
|
||||
"fetch-blob": "^3.1.4",
|
||||
"formdata-polyfill": "^4.0.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/node-fetch"
|
||||
}
|
||||
},
|
||||
"node_modules/node-gyp": {
|
||||
|
|
@ -5263,6 +5408,11 @@
|
|||
"url": "https://github.com/fb55/nth-check?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/obliterator": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz",
|
||||
"integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ=="
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
|
|
@ -5353,6 +5503,25 @@
|
|||
"undici-types": "~5.26.4"
|
||||
}
|
||||
},
|
||||
"node_modules/openai/node_modules/node-fetch": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
||||
|
|
|
|||
|
|
@ -19,12 +19,15 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@octokit/rest": "^20.0.2",
|
||||
"@types/node-fetch": "^2.6.11",
|
||||
"@xenova/transformers": "^2.14.0",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"dotenv": "^16.3.1",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
"handlebars": "^4.7.8",
|
||||
"js-tiktoken": "^1.0.8",
|
||||
"llm-code-highlighter": "^0.0.3",
|
||||
"node-fetch": "^3.3.2",
|
||||
"node-html-markdown": "^1.3.0",
|
||||
"openai": "^4.20.1",
|
||||
"replicate": "^0.23.0",
|
||||
|
|
|
|||
34
core/test.ts
Normal file
34
core/test.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { open } from "sqlite";
|
||||
import sqlite3 from "sqlite3";
|
||||
|
||||
async function test() {
|
||||
const db = await open({
|
||||
filename:
|
||||
"/Users/natesesti/Library/Application Support/Code - Insiders/User/globalStorage/state.vscdb",
|
||||
driver: sqlite3.Database,
|
||||
});
|
||||
|
||||
const rows = await db.all(
|
||||
"SELECT * FROM ItemTable WHERE key = 'workbench.auxiliarybar.pinnedPanels'"
|
||||
);
|
||||
|
||||
const pinnedPanels = rows[0].value === "" ? [] : JSON.parse(rows[0].value);
|
||||
|
||||
if (
|
||||
!pinnedPanels.find(
|
||||
(panel: any) => panel.id === "workbench.view.extension.continue"
|
||||
)
|
||||
) {
|
||||
pinnedPanels.push({
|
||||
id: "workbench.view.extension.continue",
|
||||
pinned: true,
|
||||
order: 15,
|
||||
});
|
||||
await db.run(
|
||||
`UPDATE ItemTable SET value = ? WHERE key = 'workbench.auxiliarybar.pinnedPanels'`,
|
||||
JSON.stringify(pinnedPanels)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default test;
|
||||
|
|
@ -120,7 +120,7 @@ export function renderPromptTemplate(
|
|||
}
|
||||
}
|
||||
|
||||
export function getBasename(filepath: string): string {
|
||||
export function getBasename(filepath: string, n: number = 1): string {
|
||||
return filepath.split(/[\\/]/).pop() || "";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
type JsonObject = { [key: string]: any };
|
||||
|
||||
export function mergeJson(first: JsonObject, second: JsonObject): any {
|
||||
first = { ...first };
|
||||
|
||||
try {
|
||||
for (var key in second) {
|
||||
let secondValue = second[key];
|
||||
|
|
|
|||
|
|
@ -176,6 +176,10 @@ export function getLanceDbPath(): string {
|
|||
return path.join(getIndexFolderPath(), "lancedb");
|
||||
}
|
||||
|
||||
export function getTabAutocompleteCacheSqlitePath(): string {
|
||||
return path.join(getIndexFolderPath(), "autocompleteCache.sqlite");
|
||||
}
|
||||
|
||||
export function getDocsSqlitePath(): string {
|
||||
return path.join(getIndexFolderPath(), "docs.sqlite");
|
||||
}
|
||||
|
|
|
|||
93
core/util/treeSitter.ts
Normal file
93
core/util/treeSitter.ts
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
import * as path from "path";
|
||||
import Parser from "web-tree-sitter";
|
||||
|
||||
export const supportedLanguages: { [key: string]: string } = {
|
||||
cpp: "cpp",
|
||||
hpp: "cpp",
|
||||
cc: "cpp",
|
||||
cxx: "cpp",
|
||||
hxx: "cpp",
|
||||
cs: "c_sharp",
|
||||
c: "c",
|
||||
h: "c",
|
||||
css: "css",
|
||||
php: "php",
|
||||
phtml: "php",
|
||||
php3: "php",
|
||||
php4: "php",
|
||||
php5: "php",
|
||||
php7: "php",
|
||||
phps: "php",
|
||||
"php-s": "php",
|
||||
bash: "bash",
|
||||
sh: "bash",
|
||||
json: "json",
|
||||
ts: "typescript",
|
||||
mts: "typescript",
|
||||
cts: "typescript",
|
||||
tsx: "tsx",
|
||||
vue: "vue",
|
||||
yaml: "yaml",
|
||||
yml: "yaml",
|
||||
elm: "elm",
|
||||
js: "javascript",
|
||||
jsx: "javascript",
|
||||
mjs: "javascript",
|
||||
cjs: "javascript",
|
||||
py: "python",
|
||||
pyw: "python",
|
||||
pyi: "python",
|
||||
el: "elisp",
|
||||
emacs: "elisp",
|
||||
ex: "elixir",
|
||||
exs: "elixir",
|
||||
go: "go",
|
||||
eex: "embedded_template",
|
||||
heex: "embedded_template",
|
||||
leex: "embedded_template",
|
||||
html: "html",
|
||||
htm: "html",
|
||||
java: "java",
|
||||
lua: "lua",
|
||||
ocaml: "ocaml",
|
||||
ml: "ocaml",
|
||||
mli: "ocaml",
|
||||
ql: "ql",
|
||||
res: "rescript",
|
||||
resi: "rescript",
|
||||
rb: "ruby",
|
||||
erb: "ruby",
|
||||
rs: "rust",
|
||||
rdl: "systemrdl",
|
||||
toml: "toml",
|
||||
|
||||
// jl: "julia",
|
||||
// swift: "swift",
|
||||
// kt: "kotlin",
|
||||
// scala: "scala",
|
||||
};
|
||||
|
||||
export async function getParserForFile(filepath: string) {
|
||||
await Parser.init();
|
||||
const parser = new Parser();
|
||||
const extension = path.extname(filepath).slice(1);
|
||||
|
||||
if (!supportedLanguages[extension]) {
|
||||
console.warn(
|
||||
"Unable to load language for file",
|
||||
extension,
|
||||
"from path: ",
|
||||
filepath
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const wasmPath = path.join(
|
||||
__dirname,
|
||||
"tree-sitter-wasms",
|
||||
`tree-sitter-${supportedLanguages[extension]}.wasm`
|
||||
);
|
||||
const Language = await Parser.Language.load(wasmPath);
|
||||
parser.setLanguage(Language);
|
||||
return parser;
|
||||
}
|
||||
118
core/yarn.lock
118
core/yarn.lock
|
|
@ -880,7 +880,7 @@
|
|||
resolved "https://registry.npmjs.org/@types/mustache/-/mustache-4.2.5.tgz"
|
||||
integrity sha512-PLwiVvTBg59tGFL/8VpcGvqOu3L4OuveNvPi0EYbWchRdEVP++yRUXJPFl+CApKEq13017/4Nf7aQ5lTtHUNsA==
|
||||
|
||||
"@types/node-fetch@^2.6.4":
|
||||
"@types/node-fetch@^2.6.11", "@types/node-fetch@^2.6.4":
|
||||
version "2.6.11"
|
||||
resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz"
|
||||
integrity sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==
|
||||
|
|
@ -950,6 +950,11 @@
|
|||
optionalDependencies:
|
||||
onnxruntime-node "1.14.0"
|
||||
|
||||
"@yomguithereal/helpers@^1.1.1":
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/@yomguithereal/helpers/-/helpers-1.1.1.tgz"
|
||||
integrity sha512-UYvAq/XCA7xoh1juWDYsq3W0WywOB+pz8cgVnE1b45ZfdMhBvHDrgmSFG3jXeZSr2tMTYLGHFHON+ekG05Jebg==
|
||||
|
||||
abbrev@1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz"
|
||||
|
|
@ -1518,6 +1523,11 @@ css-what@^6.1.0:
|
|||
resolved "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz"
|
||||
integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==
|
||||
|
||||
data-uri-to-buffer@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz"
|
||||
integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==
|
||||
|
||||
debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@~4.3.1, debug@~4.3.2, debug@4:
|
||||
version "4.3.4"
|
||||
resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz"
|
||||
|
|
@ -1741,6 +1751,11 @@ event-target-shim@^5.0.0:
|
|||
resolved "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz"
|
||||
integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
|
||||
|
||||
events@^3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz"
|
||||
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
|
||||
|
||||
execa@^5.0.0:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz"
|
||||
|
|
@ -1799,6 +1814,14 @@ fb-watchman@^2.0.0:
|
|||
dependencies:
|
||||
bser "2.1.1"
|
||||
|
||||
fetch-blob@^3.1.2, fetch-blob@^3.1.4:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz"
|
||||
integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==
|
||||
dependencies:
|
||||
node-domexception "^1.0.0"
|
||||
web-streams-polyfill "^3.0.3"
|
||||
|
||||
file-uri-to-path@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz"
|
||||
|
|
@ -1863,6 +1886,13 @@ formdata-node@^4.3.2:
|
|||
node-domexception "1.0.0"
|
||||
web-streams-polyfill "4.0.0-beta.3"
|
||||
|
||||
formdata-polyfill@^4.0.10:
|
||||
version "4.0.10"
|
||||
resolved "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz"
|
||||
integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==
|
||||
dependencies:
|
||||
fetch-blob "^3.1.2"
|
||||
|
||||
fs-constants@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz"
|
||||
|
|
@ -1951,6 +1981,51 @@ graceful-fs@^4.2.6, graceful-fs@^4.2.9:
|
|||
resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz"
|
||||
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
|
||||
|
||||
graphology-indices@^0.17.0:
|
||||
version "0.17.0"
|
||||
resolved "https://registry.npmjs.org/graphology-indices/-/graphology-indices-0.17.0.tgz"
|
||||
integrity sha512-A7RXuKQvdqSWOpn7ZVQo4S33O0vCfPBnUSf7FwE0zNCasqwZVUaCXePuWo5HBpWw68KJcwObZDHpFk6HKH6MYQ==
|
||||
dependencies:
|
||||
graphology-utils "^2.4.2"
|
||||
mnemonist "^0.39.0"
|
||||
|
||||
graphology-metrics@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.npmjs.org/graphology-metrics/-/graphology-metrics-2.2.0.tgz"
|
||||
integrity sha512-eZZFRLGGyyI+iD+XwQvc+lLM3EKCoqUvVjvF/14Htgy4grB2m95OytToYq3saWuHfuf22VVnj9GBHv/pTzKuTw==
|
||||
dependencies:
|
||||
graphology-shortest-path "^2.0.0"
|
||||
graphology-utils "^2.4.4"
|
||||
mnemonist "^0.39.0"
|
||||
|
||||
graphology-shortest-path@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.npmjs.org/graphology-shortest-path/-/graphology-shortest-path-2.0.2.tgz"
|
||||
integrity sha512-hlGvh4Yb1Vmd2J7wT8Q8+t4RQ6Tx+9wRYm0/fZB9PZJ4uW3nml5kJ7yXZ2+JYWT+7wLLmY5mg3o9bLSAWmv/jQ==
|
||||
dependencies:
|
||||
"@yomguithereal/helpers" "^1.1.1"
|
||||
graphology-indices "^0.17.0"
|
||||
graphology-utils "^2.4.3"
|
||||
mnemonist "^0.39.0"
|
||||
|
||||
graphology-types@>=0.20.0, graphology-types@>=0.23.0, graphology-types@>=0.24.0:
|
||||
version "0.24.7"
|
||||
resolved "https://registry.npmjs.org/graphology-types/-/graphology-types-0.24.7.tgz"
|
||||
integrity sha512-tdcqOOpwArNjEr0gNQKCXwaNCWnQJrog14nJNQPeemcLnXQUUGrsCWpWkVKt46zLjcS6/KGoayeJfHHyPDlvwA==
|
||||
|
||||
graphology-utils@^2.4.2, graphology-utils@^2.4.3, graphology-utils@^2.4.4:
|
||||
version "2.5.2"
|
||||
resolved "https://registry.npmjs.org/graphology-utils/-/graphology-utils-2.5.2.tgz"
|
||||
integrity sha512-ckHg8MXrXJkOARk56ZaSCM1g1Wihe2d6iTmz1enGOz4W/l831MBCKSayeFQfowgF8wd+PQ4rlch/56Vs/VZLDQ==
|
||||
|
||||
graphology@^0.25.4:
|
||||
version "0.25.4"
|
||||
resolved "https://registry.npmjs.org/graphology/-/graphology-0.25.4.tgz"
|
||||
integrity sha512-33g0Ol9nkWdD6ulw687viS8YJQBxqG5LWII6FI6nul0pq6iM2t5EKquOTFDbyTblRB3O9I+7KX4xI8u5ffekAQ==
|
||||
dependencies:
|
||||
events "^3.3.0"
|
||||
obliterator "^2.0.2"
|
||||
|
||||
guid-typescript@^1.0.9:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz"
|
||||
|
|
@ -2620,6 +2695,17 @@ lines-and-columns@^1.1.6:
|
|||
resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz"
|
||||
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
|
||||
|
||||
llm-code-highlighter@^0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.npmjs.org/llm-code-highlighter/-/llm-code-highlighter-0.0.3.tgz"
|
||||
integrity sha512-l/R+m6ngXRTYxzoCzqpBk5TiSVpS4Ek9fKx/PIy25HV6XDbCC6iOfVITPPSTGkh7NlI+tN5vWjdqUfN3YW+HwQ==
|
||||
dependencies:
|
||||
graphology "^0.25.4"
|
||||
graphology-metrics "^2.2.0"
|
||||
lodash "^4.17.21"
|
||||
tree-sitter-wasms "^0.1.6"
|
||||
web-tree-sitter "^0.20.8"
|
||||
|
||||
locate-path@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz"
|
||||
|
|
@ -2642,6 +2728,11 @@ lodash.memoize@4.x:
|
|||
resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz"
|
||||
integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==
|
||||
|
||||
lodash@^4.17.21:
|
||||
version "4.17.21"
|
||||
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
||||
long@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz"
|
||||
|
|
@ -2827,6 +2918,13 @@ mkdirp@^1.0.3, mkdirp@^1.0.4:
|
|||
resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz"
|
||||
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
|
||||
|
||||
mnemonist@^0.39.0:
|
||||
version "0.39.7"
|
||||
resolved "https://registry.npmjs.org/mnemonist/-/mnemonist-0.39.7.tgz"
|
||||
integrity sha512-ix3FwHWZgdXUt0dHM8bCrI4r1KMeYx8bCunPCYmvKXq4tn6gbNsqrsb4q0kDbDqbpIOvEaW5Sn+dmDwGydfrwA==
|
||||
dependencies:
|
||||
obliterator "^2.0.1"
|
||||
|
||||
ms@^2.0.0, ms@2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz"
|
||||
|
|
@ -2869,7 +2967,7 @@ node-addon-api@^7.0.0:
|
|||
resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz"
|
||||
integrity sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==
|
||||
|
||||
node-domexception@1.0.0:
|
||||
node-domexception@^1.0.0, node-domexception@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz"
|
||||
integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==
|
||||
|
|
@ -2881,6 +2979,15 @@ node-fetch@^2.6.7:
|
|||
dependencies:
|
||||
whatwg-url "^5.0.0"
|
||||
|
||||
node-fetch@^3.3.2:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz"
|
||||
integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==
|
||||
dependencies:
|
||||
data-uri-to-buffer "^4.0.0"
|
||||
fetch-blob "^3.1.4"
|
||||
formdata-polyfill "^4.0.10"
|
||||
|
||||
node-gyp@8.x:
|
||||
version "8.4.1"
|
||||
resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz"
|
||||
|
|
@ -2958,6 +3065,11 @@ nth-check@^2.0.1:
|
|||
dependencies:
|
||||
boolbase "^1.0.0"
|
||||
|
||||
obliterator@^2.0.1, obliterator@^2.0.2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz"
|
||||
integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==
|
||||
|
||||
once@^1.3.0, once@^1.3.1, once@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz"
|
||||
|
|
@ -3809,7 +3921,7 @@ walker@^1.0.8:
|
|||
dependencies:
|
||||
makeerror "1.0.12"
|
||||
|
||||
web-streams-polyfill@^3.2.1:
|
||||
web-streams-polyfill@^3.0.3, web-streams-polyfill@^3.2.1:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz"
|
||||
integrity sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==
|
||||
|
|
|
|||
|
|
@ -263,8 +263,6 @@ The flow of information in the above example is as follows:
|
|||
|
||||
### Importing outside modules
|
||||
|
||||
> Context providers run in a NodeJS environment, but for the time being the `modifyConfig` function will be called both from NodeJS _and_ the browser. This means that if you are importing packages requiring NodeJS, you should dynamically import them inside of the context provider (e.g. `const moduleA = await import('./moduleA');`).
|
||||
|
||||
To include outside Node modules in your config.ts, run `npm install <module_name>` from the `~/.continue` directory, and then import them in config.ts.
|
||||
|
||||
Continue will use [esbuild](https://esbuild.github.io/) to bundle your `config.ts` and any dependencies into a single Javascript file. The exact configuration used can be found [here](https://github.com/continuedev/continue/blob/5c9874400e223bbc9786a8823614a2e501fbdaf7/extensions/vscode/src/ideProtocol.ts#L45-L52).
|
||||
|
|
|
|||
|
|
@ -138,3 +138,5 @@ export function modifyConfig(config: Config): Config {
|
|||
Continue respects `.gitignore` files in order to determine which files should not be indexed. If you'd like to exclude additional files, you can add them to a `.continueignore` file, which follows the exact same rules as `.gitignore`.
|
||||
|
||||
If you want to see exactly what files Continue has indexed, the metadata is stored in `~/.continue/index/index.sqlite`. You can use a tool like [DB Browser for SQLite](https://sqlitebrowser.org/) to view the `tags_catalog` table within this file.
|
||||
|
||||
If you need to force a refresh of the index, reload the VS Code window with `cmd/ctrl + shift + p` + "Reload Window".
|
||||
|
|
|
|||
80
docs/static/schemas/config.json
vendored
80
docs/static/schemas/config.json
vendored
|
|
@ -59,7 +59,7 @@
|
|||
"timeout": {
|
||||
"title": "Timeout",
|
||||
"description": "Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.",
|
||||
"default": 300,
|
||||
"default": 7200,
|
||||
"type": "integer"
|
||||
},
|
||||
"verifySsl": {
|
||||
|
|
@ -212,7 +212,7 @@
|
|||
"title": "Request Options",
|
||||
"description": "Options for the HTTP request to the LLM.",
|
||||
"default": {
|
||||
"timeout": 300,
|
||||
"timeout": 7200,
|
||||
"verifySsl": null,
|
||||
"caBundlePath": null,
|
||||
"proxy": null,
|
||||
|
|
@ -435,10 +435,13 @@
|
|||
"wizardcoder-34b",
|
||||
"zephyr-7b",
|
||||
"codeup-13b",
|
||||
"deepseek-1b",
|
||||
"deepseek-7b",
|
||||
"deepseek-33b",
|
||||
"neural-chat-7b"
|
||||
"neural-chat-7b",
|
||||
"deepseek-1b",
|
||||
"stable-code-3b",
|
||||
"starcoder-1b",
|
||||
"starcoder-3b"
|
||||
]
|
||||
},
|
||||
{ "type": "string" }
|
||||
|
|
@ -569,10 +572,13 @@
|
|||
"wizardcoder-34b",
|
||||
"zephyr-7b",
|
||||
"codeup-13b",
|
||||
"deepseek-1b",
|
||||
"deepseek-7b",
|
||||
"deepseek-33b",
|
||||
"neural-chat-7b"
|
||||
"neural-chat-7b",
|
||||
"deepseek-1b",
|
||||
"stable-code-3b",
|
||||
"starcoder-1b",
|
||||
"starcoder-3b"
|
||||
]
|
||||
},
|
||||
{ "type": "string" }
|
||||
|
|
@ -610,10 +616,13 @@
|
|||
"wizardcoder-34b",
|
||||
"zephyr-7b",
|
||||
"codeup-13b",
|
||||
"deepseek-1b",
|
||||
"deepseek-7b",
|
||||
"deepseek-33b",
|
||||
"neural-chat-7b"
|
||||
"neural-chat-7b",
|
||||
"deepseek-1b",
|
||||
"stable-code-3b",
|
||||
"starcoder-1b",
|
||||
"starcoder-3b"
|
||||
]
|
||||
},
|
||||
{ "type": "string" }
|
||||
|
|
@ -785,7 +794,6 @@
|
|||
"wizardcoder-34b",
|
||||
"zephyr-7b",
|
||||
"codeup-13b",
|
||||
"deepseek-1b",
|
||||
"deepseek-7b",
|
||||
"deepseek-33b",
|
||||
"claude-2",
|
||||
|
|
@ -793,7 +801,11 @@
|
|||
"gemini-pro",
|
||||
"mistral-tiny",
|
||||
"mistral-small",
|
||||
"mistral-medium"
|
||||
"mistral-medium",
|
||||
"deepseek-1b",
|
||||
"stable-code-3b",
|
||||
"starcoder-1b",
|
||||
"starcoder-3b"
|
||||
]
|
||||
},
|
||||
{ "type": "string" }
|
||||
|
|
@ -985,7 +997,8 @@
|
|||
"Reference GitHub issues from a repository",
|
||||
"Retrieve important pages from a documentation website, as determined by similarity search",
|
||||
"Index and retrieve the contents of any documentation site, using embeddings to find important snippets",
|
||||
"Display a file tree of the current workspace"
|
||||
"Display a file tree of the current workspace",
|
||||
"Include a repo map showing important code objects"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
@ -1295,6 +1308,51 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"tabAutocompleteModel": {
|
||||
"title": "Tab Autocomplete Model",
|
||||
"markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using deepseek-coder:1.3b-base on a local Ollama instance.",
|
||||
"default": {
|
||||
"title": "Tab Autocomplete Model",
|
||||
"provider": "ollama",
|
||||
"model": "deepseek-coder:1.3b-base"
|
||||
},
|
||||
"$ref": "#/definitions/ModelDescription"
|
||||
},
|
||||
"tabAutocompleteOptions": {
|
||||
"title": "TabAutocompleteOptions",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"useCopyBuffer": {
|
||||
"type": "boolean",
|
||||
"description": "Determines whether the copy buffer will be considered when contructing the prompt."
|
||||
},
|
||||
"useSuffix": {
|
||||
"type": "boolean",
|
||||
"description": "Determines whether to use the file suffix in the prompt."
|
||||
},
|
||||
"maxPromptTokens": {
|
||||
"type": "number",
|
||||
"description": "The maximum number of prompt tokens to use. A smaller number will yield faster completions, but less context."
|
||||
},
|
||||
"debounceDelay": {
|
||||
"type": "number",
|
||||
"description": "The delay in milliseconds before triggering autocomplete after a keystroke."
|
||||
},
|
||||
"maxSuffixPercentage": {
|
||||
"type": "number",
|
||||
"description": "The maximum percentage of the prompt that can be dedicated to the suffix."
|
||||
},
|
||||
"prefixPercentage": {
|
||||
"type": "number",
|
||||
"description": "The percentage of the input that should be dedicated to the prefix."
|
||||
},
|
||||
"template": {
|
||||
"type": "string",
|
||||
"description": "An optional template string to be used for autocomplete. It will be rendered with the Mustache templating language, and is passed the 'prefix' and 'suffix' variables."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
9
extensions/vscode/.continuerc.json
Normal file
9
extensions/vscode/.continuerc.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"customCommands": [
|
||||
{
|
||||
"name": "hello",
|
||||
"prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
|
||||
"description": "This is an example custom command. Use /config to edit it and create more"
|
||||
}
|
||||
]
|
||||
}
|
||||
10
extensions/vscode/.gitignore
vendored
10
extensions/vscode/.gitignore
vendored
|
|
@ -6,6 +6,12 @@ data/
|
|||
src/client
|
||||
.continue
|
||||
|
||||
gui
|
||||
exe
|
||||
bin
|
||||
bin
|
||||
assets
|
||||
|
||||
gui/*
|
||||
!gui/onigasm.wasm
|
||||
|
||||
.devcontainer
|
||||
.github
|
||||
|
|
@ -12,6 +12,8 @@ Pre-release Changes
|
|||
* Full-text search index for retrieval
|
||||
* Docs context provider
|
||||
* CodeLlama-70b support
|
||||
### Changed
|
||||
* config.ts only runs in NodeJS, not browser
|
||||
### Fixed
|
||||
* Fixed proxy setting in config.json
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
> 🎁 **New! [Try out the new JetBrains extension (Alpha)](https://plugins.jetbrains.com/plugin/22707-continue-extension)**
|
||||
> 🎉 **Tab autocomplete now available in pre-release (experimental)**
|
||||
|
||||

|
||||
|
||||
|
|
@ -6,31 +6,31 @@
|
|||
|
||||
<div align="center">
|
||||
|
||||
**[Continue](https://continue.dev/docs) is the open-source autopilot for software development—an IDE extension that brings the power of ChatGPT to [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension)**
|
||||
**[Continue](https://continue.dev/docs) is an open-source autopilot for VS Code and JetBrains—the easiest way to code with any LLM**
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<a target="_blank" href="https://opensource.org/licenses/Apache-2.0" style="background:none">
|
||||
<img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" style="height: 36px;" />
|
||||
<img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" style="height: 20px;" />
|
||||
</a>
|
||||
<a target="_blank" href="https://continue.dev/docs" style="background:none">
|
||||
<img src="https://img.shields.io/badge/continue_docs-%23BE1B55" style="height: 36px;" />
|
||||
<img src="https://img.shields.io/badge/continue_docs-%23BE1B55" style="height: 20px;" />
|
||||
</a>
|
||||
<a target="_blank" href="https://discord.gg/vapESyrFmJ" style="background:none">
|
||||
<img src="https://img.shields.io/badge/discord-join-continue.svg?labelColor=191937&color=6F6FF7&logo=discord" style="height: 36px;" />
|
||||
<img src="https://img.shields.io/badge/discord-join-continue.svg?labelColor=191937&color=6F6FF7&logo=discord" style="height: 20px;" />
|
||||
</a>
|
||||
|
||||
<p></p>
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## Task, not tab, auto-complete
|
||||
# ⏩ Features
|
||||
|
||||
### Get possible explanations
|
||||
# 🔎 Ask about highlighted code
|
||||
|
||||

|
||||
|
||||
Highlight + select code sections and ask a question to get another perspective
|
||||
|
||||
|
|
@ -38,7 +38,19 @@ Highlight + select code sections and ask a question to get another perspective
|
|||
- “where in the page should I be making this request to the backend?”
|
||||
- “how can I communicate between these iframes?”
|
||||
|
||||
### Edit in natural language
|
||||
# 🪄 Reference context inline
|
||||
|
||||

|
||||
|
||||
- "@diff check my commit for mistakes"
|
||||
- "how does @server.py stream responses?"
|
||||
- "how do i fix this error in the @terminal?"
|
||||
|
||||
# ⚡️ Get completions directly in your editor
|
||||
|
||||

|
||||
|
||||
# ✏️ Edit in natural language
|
||||
|
||||
Highlight + select a section of code and instruct Continue to refactor it
|
||||
|
||||
|
|
@ -46,15 +58,19 @@ Highlight + select a section of code and instruct Continue to refactor it
|
|||
- “/edit change this plot into a bar chart in this dashboard component”
|
||||
- “/edit rewrite this function to be async”
|
||||
|
||||
### Generate files from scratch
|
||||

|
||||
|
||||
Open a blank file and let Continue start new Python scripts, React components, etc.
|
||||
# 🚀 Generate files from scratch
|
||||
|
||||
- “/edit here is a connector for postgres, now write one for kafka”
|
||||
- “/edit make an IAM policy that creates a user with read-only access to S3”
|
||||
- “/edit use this schema to write me a SQL query that gets recently churned users”
|
||||

|
||||
|
||||
## Getting Started
|
||||
Open a blank file, <kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>L</kbd>, and let Continue start new Python scripts, React components, etc.
|
||||
|
||||
- “here is a connector for postgres, now write one for kafka”
|
||||
- “make an IAM policy that creates a user with read-only access to S3”
|
||||
- “use this schema to write me a SQL query that gets recently churned users”
|
||||
|
||||
# Getting Started
|
||||
|
||||
You can try out Continue for free using a proxy server that securely makes calls with our API key to models like GPT-4, Gemini Pro, and Phind CodeLlama via OpenAI, Google, and Together respectively.
|
||||
|
||||
|
|
@ -62,4 +78,4 @@ Once you're ready to use your own API key or a different model / provider, press
|
|||
|
||||
## License
|
||||
|
||||
[Apache 2.0 © 2023 Continue Dev, Inc.](./LICENSE)
|
||||
[Apache 2.0 © 2023 Continue Dev, Inc.](./LICENSE)
|
||||
|
|
|
|||
128
extensions/vscode/builtin-themes/dark_modern.json
Normal file
128
extensions/vscode/builtin-themes/dark_modern.json
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Default Dark Modern",
|
||||
"include": "./dark_plus.json",
|
||||
"colors": {
|
||||
"activityBar.activeBorder": "#0078D4",
|
||||
"activityBar.background": "#181818",
|
||||
"activityBar.border": "#2B2B2B",
|
||||
"activityBar.foreground": "#D7D7D7",
|
||||
"activityBar.inactiveForeground": "#868686",
|
||||
"activityBarBadge.background": "#0078D4",
|
||||
"activityBarBadge.foreground": "#FFFFFF",
|
||||
"badge.background": "#616161",
|
||||
"badge.foreground": "#F8F8F8",
|
||||
"button.background": "#0078D4",
|
||||
"button.border": "#FFFFFF12",
|
||||
"button.foreground": "#FFFFFF",
|
||||
"button.hoverBackground": "#026EC1",
|
||||
"button.secondaryBackground": "#313131",
|
||||
"button.secondaryForeground": "#CCCCCC",
|
||||
"button.secondaryHoverBackground": "#3C3C3C",
|
||||
"chat.slashCommandBackground": "#34414B",
|
||||
"chat.slashCommandForeground": "#40A6FF",
|
||||
"checkbox.background": "#313131",
|
||||
"checkbox.border": "#3C3C3C",
|
||||
"debugToolBar.background": "#181818",
|
||||
"descriptionForeground": "#9D9D9D",
|
||||
"dropdown.background": "#313131",
|
||||
"dropdown.border": "#3C3C3C",
|
||||
"dropdown.foreground": "#CCCCCC",
|
||||
"dropdown.listBackground": "#1F1F1F",
|
||||
"editor.background": "#1F1F1F",
|
||||
"editor.findMatchBackground": "#9E6A03",
|
||||
"editor.foreground": "#CCCCCC",
|
||||
"editorGroup.border": "#FFFFFF17",
|
||||
"editorGroupHeader.tabsBackground": "#181818",
|
||||
"editorGroupHeader.tabsBorder": "#2B2B2B",
|
||||
"editorGutter.addedBackground": "#2EA043",
|
||||
"editorGutter.deletedBackground": "#F85149",
|
||||
"editorGutter.modifiedBackground": "#0078D4",
|
||||
"editorLineNumber.activeForeground": "#CCCCCC",
|
||||
"editorLineNumber.foreground": "#6E7681",
|
||||
"editorOverviewRuler.border": "#010409",
|
||||
"editorWidget.background": "#202020",
|
||||
"errorForeground": "#F85149",
|
||||
"focusBorder": "#0078D4",
|
||||
"foreground": "#CCCCCC",
|
||||
"icon.foreground": "#CCCCCC",
|
||||
"input.background": "#313131",
|
||||
"input.border": "#3C3C3C",
|
||||
"input.foreground": "#CCCCCC",
|
||||
"input.placeholderForeground": "#989898",
|
||||
"inputOption.activeBackground": "#2489DB82",
|
||||
"inputOption.activeBorder": "#2488DB",
|
||||
"keybindingLabel.foreground": "#CCCCCC",
|
||||
"menu.background": "#1F1F1F",
|
||||
"notificationCenterHeader.background": "#1F1F1F",
|
||||
"notificationCenterHeader.foreground": "#CCCCCC",
|
||||
"notifications.background": "#1F1F1F",
|
||||
"notifications.border": "#2B2B2B",
|
||||
"notifications.foreground": "#CCCCCC",
|
||||
"panel.background": "#181818",
|
||||
"panel.border": "#2B2B2B",
|
||||
"panelInput.border": "#2B2B2B",
|
||||
"panelTitle.activeBorder": "#0078D4",
|
||||
"panelTitle.activeForeground": "#CCCCCC",
|
||||
"panelTitle.inactiveForeground": "#9D9D9D",
|
||||
"peekViewEditor.background": "#1F1F1F",
|
||||
"peekViewEditor.matchHighlightBackground": "#BB800966",
|
||||
"peekViewResult.background": "#1F1F1F",
|
||||
"peekViewResult.matchHighlightBackground": "#BB800966",
|
||||
"pickerGroup.border": "#3C3C3C",
|
||||
"progressBar.background": "#0078D4",
|
||||
"quickInput.background": "#222222",
|
||||
"quickInput.foreground": "#CCCCCC",
|
||||
"settings.dropdownBackground": "#313131",
|
||||
"settings.dropdownBorder": "#3C3C3C",
|
||||
"settings.headerForeground": "#FFFFFF",
|
||||
"settings.modifiedItemIndicator": "#BB800966",
|
||||
"sideBar.background": "#181818",
|
||||
"sideBar.border": "#2B2B2B",
|
||||
"sideBar.foreground": "#CCCCCC",
|
||||
"sideBarSectionHeader.background": "#181818",
|
||||
"sideBarSectionHeader.border": "#2B2B2B",
|
||||
"sideBarSectionHeader.foreground": "#CCCCCC",
|
||||
"sideBarTitle.foreground": "#CCCCCC",
|
||||
"statusBar.background": "#181818",
|
||||
"statusBar.border": "#2B2B2B",
|
||||
"statusBar.debuggingBackground": "#0078D4",
|
||||
"statusBar.debuggingForeground": "#FFFFFF",
|
||||
"statusBar.focusBorder": "#0078D4",
|
||||
"statusBar.foreground": "#CCCCCC",
|
||||
"statusBar.noFolderBackground": "#1F1F1F",
|
||||
"statusBarItem.focusBorder": "#0078D4",
|
||||
"statusBarItem.prominentBackground": "#6E768166",
|
||||
"statusBarItem.remoteBackground": "#0078D4",
|
||||
"statusBarItem.remoteForeground": "#FFFFFF",
|
||||
"tab.activeBackground": "#1F1F1F",
|
||||
"tab.activeBorder": "#1F1F1F",
|
||||
"tab.activeBorderTop": "#0078D4",
|
||||
"tab.activeForeground": "#FFFFFF",
|
||||
"tab.border": "#2B2B2B",
|
||||
"tab.hoverBackground": "#1F1F1F",
|
||||
"tab.inactiveBackground": "#181818",
|
||||
"tab.inactiveForeground": "#9D9D9D",
|
||||
"tab.unfocusedActiveBorder": "#1F1F1F",
|
||||
"tab.unfocusedActiveBorderTop": "#2B2B2B",
|
||||
"tab.unfocusedHoverBackground": "#1F1F1F",
|
||||
"terminal.foreground": "#CCCCCC",
|
||||
"terminal.tab.activeBorder": "#0078D4",
|
||||
"textBlockQuote.background": "#2B2B2B",
|
||||
"textBlockQuote.border": "#616161",
|
||||
"textCodeBlock.background": "#2B2B2B",
|
||||
"textLink.activeForeground": "#4daafc",
|
||||
"textLink.foreground": "#4daafc",
|
||||
"textPreformat.foreground": "#D0D0D0",
|
||||
"textPreformat.background": "#3C3C3C",
|
||||
"textSeparator.foreground": "#21262D",
|
||||
"titleBar.activeBackground": "#181818",
|
||||
"titleBar.activeForeground": "#CCCCCC",
|
||||
"titleBar.border": "#2B2B2B",
|
||||
"titleBar.inactiveBackground": "#1F1F1F",
|
||||
"titleBar.inactiveForeground": "#9D9D9D",
|
||||
"welcomePage.tileBackground": "#2B2B2B",
|
||||
"welcomePage.progress.foreground": "#0078D4",
|
||||
"widget.border": "#313131"
|
||||
}
|
||||
}
|
||||
193
extensions/vscode/builtin-themes/dark_plus.json
Normal file
193
extensions/vscode/builtin-themes/dark_plus.json
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Dark+",
|
||||
"include": "./dark_vs.json",
|
||||
"tokenColors": [
|
||||
{
|
||||
"name": "Function declarations",
|
||||
"scope": [
|
||||
"entity.name.function",
|
||||
"support.function",
|
||||
"support.constant.handlebars",
|
||||
"source.powershell variable.other.member",
|
||||
"entity.name.operator.custom-literal"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#DCDCAA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Types declaration and references",
|
||||
"scope": [
|
||||
"support.class",
|
||||
"support.type",
|
||||
"entity.name.type",
|
||||
"entity.name.namespace",
|
||||
"entity.other.attribute",
|
||||
"entity.name.scope-resolution",
|
||||
"entity.name.class",
|
||||
"storage.type.numeric.go",
|
||||
"storage.type.byte.go",
|
||||
"storage.type.boolean.go",
|
||||
"storage.type.string.go",
|
||||
"storage.type.uintptr.go",
|
||||
"storage.type.error.go",
|
||||
"storage.type.rune.go",
|
||||
"storage.type.cs",
|
||||
"storage.type.generic.cs",
|
||||
"storage.type.modifier.cs",
|
||||
"storage.type.variable.cs",
|
||||
"storage.type.annotation.java",
|
||||
"storage.type.generic.java",
|
||||
"storage.type.java",
|
||||
"storage.type.object.array.java",
|
||||
"storage.type.primitive.array.java",
|
||||
"storage.type.primitive.java",
|
||||
"storage.type.token.java",
|
||||
"storage.type.groovy",
|
||||
"storage.type.annotation.groovy",
|
||||
"storage.type.parameters.groovy",
|
||||
"storage.type.generic.groovy",
|
||||
"storage.type.object.array.groovy",
|
||||
"storage.type.primitive.array.groovy",
|
||||
"storage.type.primitive.groovy"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Types declaration and references, TS grammar specific",
|
||||
"scope": [
|
||||
"meta.type.cast.expr",
|
||||
"meta.type.new.expr",
|
||||
"support.constant.math",
|
||||
"support.constant.dom",
|
||||
"support.constant.json",
|
||||
"entity.other.inherited-class"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Control flow / Special keywords",
|
||||
"scope": [
|
||||
"keyword.control",
|
||||
"source.cpp keyword.operator.new",
|
||||
"keyword.operator.delete",
|
||||
"keyword.other.using",
|
||||
"keyword.other.directive.using",
|
||||
"keyword.other.operator",
|
||||
"entity.name.operator"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#C586C0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Variable and parameter name",
|
||||
"scope": [
|
||||
"variable",
|
||||
"meta.definition.variable.name",
|
||||
"support.variable",
|
||||
"entity.name.variable",
|
||||
"constant.other.placeholder"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Constants and enums",
|
||||
"scope": ["variable.other.constant", "variable.other.enummember"],
|
||||
"settings": {
|
||||
"foreground": "#4FC1FF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Object keys, TS grammar specific",
|
||||
"scope": ["meta.object-literal.key"],
|
||||
"settings": {
|
||||
"foreground": "#9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "CSS property value",
|
||||
"scope": [
|
||||
"support.constant.property-value",
|
||||
"support.constant.font-name",
|
||||
"support.constant.media-type",
|
||||
"support.constant.media",
|
||||
"constant.other.color.rgb-value",
|
||||
"constant.other.rgb-value",
|
||||
"support.constant.color"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#CE9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Regular expression groups",
|
||||
"scope": [
|
||||
"punctuation.definition.group.regexp",
|
||||
"punctuation.definition.group.assertion.regexp",
|
||||
"punctuation.definition.character-class.regexp",
|
||||
"punctuation.character.set.begin.regexp",
|
||||
"punctuation.character.set.end.regexp",
|
||||
"keyword.operator.negation.regexp",
|
||||
"support.other.parenthesis.regexp"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#CE9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"constant.character.character-class.regexp",
|
||||
"constant.other.character-class.set.regexp",
|
||||
"constant.other.character-class.regexp",
|
||||
"constant.character.set.regexp"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d16969"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["keyword.operator.or.regexp", "keyword.control.anchor.regexp"],
|
||||
"settings": {
|
||||
"foreground": "#DCDCAA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.operator.quantifier.regexp",
|
||||
"settings": {
|
||||
"foreground": "#d7ba7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["constant.character", "constant.other.option"],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.character.escape",
|
||||
"settings": {
|
||||
"foreground": "#d7ba7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.label",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
}
|
||||
],
|
||||
"semanticTokenColors": {
|
||||
"newOperator": "#C586C0",
|
||||
"stringLiteral": "#ce9178",
|
||||
"customLiteral": "#DCDCAA",
|
||||
"numberLiteral": "#b5cea8"
|
||||
}
|
||||
}
|
||||
394
extensions/vscode/builtin-themes/dark_vs.json
Normal file
394
extensions/vscode/builtin-themes/dark_vs.json
Normal file
|
|
@ -0,0 +1,394 @@
|
|||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Dark (Visual Studio)",
|
||||
"colors": {
|
||||
"checkbox.border": "#6B6B6B",
|
||||
"editor.background": "#1E1E1E",
|
||||
"editor.foreground": "#D4D4D4",
|
||||
"editor.inactiveSelectionBackground": "#3A3D41",
|
||||
"editorIndentGuide.background1": "#404040",
|
||||
"editorIndentGuide.activeBackground1": "#707070",
|
||||
"editor.selectionHighlightBackground": "#ADD6FF26",
|
||||
"list.dropBackground": "#383B3D",
|
||||
"activityBarBadge.background": "#007ACC",
|
||||
"sideBarTitle.foreground": "#BBBBBB",
|
||||
"input.placeholderForeground": "#A6A6A6",
|
||||
"menu.background": "#252526",
|
||||
"menu.foreground": "#CCCCCC",
|
||||
"menu.separatorBackground": "#454545",
|
||||
"menu.border": "#454545",
|
||||
"statusBarItem.remoteForeground": "#FFF",
|
||||
"statusBarItem.remoteBackground": "#16825D",
|
||||
"ports.iconRunningProcessForeground": "#369432",
|
||||
"sideBarSectionHeader.background": "#0000",
|
||||
"sideBarSectionHeader.border": "#ccc3",
|
||||
"tab.lastPinnedBorder": "#ccc3",
|
||||
"list.activeSelectionIconForeground": "#FFF",
|
||||
"terminal.inactiveSelectionBackground": "#3A3D41",
|
||||
"widget.border": "#303031",
|
||||
"actionBar.toggledBackground": "#383a49"
|
||||
},
|
||||
"tokenColors": [
|
||||
{
|
||||
"scope": [
|
||||
"meta.embedded",
|
||||
"source.groovy.embedded",
|
||||
"string meta.image.inline.markdown",
|
||||
"variable.legacy.builtin.python"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#D4D4D4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "emphasis",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "strong",
|
||||
"settings": {
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "header",
|
||||
"settings": {
|
||||
"foreground": "#000080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "comment",
|
||||
"settings": {
|
||||
"foreground": "#6A9955"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.language",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"constant.numeric",
|
||||
"variable.other.enummember",
|
||||
"keyword.operator.plus.exponent",
|
||||
"keyword.operator.minus.exponent"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.regexp",
|
||||
"settings": {
|
||||
"foreground": "#646695"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.tag",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["entity.name.tag.css", "entity.name.tag.less"],
|
||||
"settings": {
|
||||
"foreground": "#d7ba7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.other.attribute-name",
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.other.attribute-name.class.css",
|
||||
"source.css entity.other.attribute-name.class",
|
||||
"entity.other.attribute-name.id.css",
|
||||
"entity.other.attribute-name.parent-selector.css",
|
||||
"entity.other.attribute-name.parent.less",
|
||||
"source.css entity.other.attribute-name.pseudo-class",
|
||||
"entity.other.attribute-name.pseudo-element.css",
|
||||
"source.css.less entity.other.attribute-name.id",
|
||||
"entity.other.attribute-name.scss"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d7ba7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "invalid",
|
||||
"settings": {
|
||||
"foreground": "#f44747"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.underline",
|
||||
"settings": {
|
||||
"fontStyle": "underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.bold",
|
||||
"settings": {
|
||||
"fontStyle": "bold",
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.heading",
|
||||
"settings": {
|
||||
"fontStyle": "bold",
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.italic",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.strikethrough",
|
||||
"settings": {
|
||||
"fontStyle": "strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inserted",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.deleted",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.changed",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "punctuation.definition.quote.begin.markdown",
|
||||
"settings": {
|
||||
"foreground": "#6A9955"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "punctuation.definition.list.begin.markdown",
|
||||
"settings": {
|
||||
"foreground": "#6796e6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inline.raw",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "brackets of XML/HTML tags",
|
||||
"scope": "punctuation.definition.tag",
|
||||
"settings": {
|
||||
"foreground": "#808080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["meta.preprocessor", "entity.name.function.preprocessor"],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.string",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.numeric",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.structure.dictionary.key.python",
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.diff.header",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage.type",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["storage.modifier", "keyword.operator.noexcept"],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["string", "meta.embedded.assembly"],
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.tag",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.value",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.regexp",
|
||||
"settings": {
|
||||
"foreground": "#d16969"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "String interpolation",
|
||||
"scope": [
|
||||
"punctuation.definition.template-expression.begin",
|
||||
"punctuation.definition.template-expression.end",
|
||||
"punctuation.section.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Reset JavaScript string interpolation expression",
|
||||
"scope": ["meta.template.expression"],
|
||||
"settings": {
|
||||
"foreground": "#d4d4d4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.type.vendored.property-name",
|
||||
"support.type.property-name",
|
||||
"source.css variable",
|
||||
"source.coffee.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.control",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.operator",
|
||||
"settings": {
|
||||
"foreground": "#d4d4d4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"keyword.operator.new",
|
||||
"keyword.operator.expression",
|
||||
"keyword.operator.cast",
|
||||
"keyword.operator.sizeof",
|
||||
"keyword.operator.alignof",
|
||||
"keyword.operator.typeid",
|
||||
"keyword.operator.alignas",
|
||||
"keyword.operator.instanceof",
|
||||
"keyword.operator.logical.python",
|
||||
"keyword.operator.wordlike"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.other.unit",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.section.embedded.begin.php",
|
||||
"punctuation.section.embedded.end.php"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "support.function.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.sha.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "coloring of the Java import and package identifiers",
|
||||
"scope": [
|
||||
"storage.modifier.import.java",
|
||||
"variable.language.wildcard.java",
|
||||
"storage.modifier.package.java"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d4d4d4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "this.self",
|
||||
"scope": "variable.language",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
}
|
||||
],
|
||||
"semanticHighlighting": true,
|
||||
"semanticTokenColors": {
|
||||
"newOperator": "#d4d4d4",
|
||||
"stringLiteral": "#ce9178",
|
||||
"customLiteral": "#D4D4D4",
|
||||
"numberLiteral": "#b5cea8"
|
||||
}
|
||||
}
|
||||
468
extensions/vscode/builtin-themes/hc_black.json
Normal file
468
extensions/vscode/builtin-themes/hc_black.json
Normal file
|
|
@ -0,0 +1,468 @@
|
|||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Dark High Contrast",
|
||||
"colors": {
|
||||
"editor.background": "#000000",
|
||||
"editor.foreground": "#FFFFFF",
|
||||
"editorIndentGuide.background1": "#FFFFFF",
|
||||
"editorIndentGuide.activeBackground1": "#FFFFFF",
|
||||
"sideBarTitle.foreground": "#FFFFFF",
|
||||
"selection.background": "#008000",
|
||||
"editor.selectionBackground": "#FFFFFF",
|
||||
"statusBarItem.remoteBackground": "#00000000",
|
||||
"ports.iconRunningProcessForeground": "#FFFFFF",
|
||||
"editorWhitespace.foreground": "#7c7c7c",
|
||||
"actionBar.toggledBackground": "#383a49"
|
||||
},
|
||||
"tokenColors": [
|
||||
{
|
||||
"scope": [
|
||||
"meta.embedded",
|
||||
"source.groovy.embedded",
|
||||
"string meta.image.inline.markdown",
|
||||
"variable.legacy.builtin.python"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "emphasis",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "strong",
|
||||
"settings": {
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.diff.header",
|
||||
"settings": {
|
||||
"foreground": "#000080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "comment",
|
||||
"settings": {
|
||||
"foreground": "#7ca668"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.language",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"constant.numeric",
|
||||
"constant.other.color.rgb-value",
|
||||
"constant.other.rgb-value",
|
||||
"support.constant.color"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.regexp",
|
||||
"settings": {
|
||||
"foreground": "#b46695"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.character",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.tag",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.name.tag.css",
|
||||
"entity.name.tag.less"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d7ba7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.other.attribute-name",
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.other.attribute-name.class.css",
|
||||
"source.css entity.other.attribute-name.class",
|
||||
"entity.other.attribute-name.id.css",
|
||||
"entity.other.attribute-name.parent-selector.css",
|
||||
"entity.other.attribute-name.parent.less",
|
||||
"source.css entity.other.attribute-name.pseudo-class",
|
||||
"entity.other.attribute-name.pseudo-element.css",
|
||||
"source.css.less entity.other.attribute-name.id",
|
||||
"entity.other.attribute-name.scss"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d7ba7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "invalid",
|
||||
"settings": {
|
||||
"foreground": "#f44747"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.underline",
|
||||
"settings": {
|
||||
"fontStyle": "underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.bold",
|
||||
"settings": {
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.heading",
|
||||
"settings": {
|
||||
"fontStyle": "bold",
|
||||
"foreground": "#6796e6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.italic",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.strikethrough",
|
||||
"settings": {
|
||||
"fontStyle": "strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inserted",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.deleted",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.changed",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "brackets of XML/HTML tags",
|
||||
"scope": [
|
||||
"punctuation.definition.tag"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#808080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.string",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.numeric",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.structure.dictionary.key.python",
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage.type",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage.modifier",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.tag",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.value",
|
||||
"settings": {
|
||||
"foreground": "#ce9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.regexp",
|
||||
"settings": {
|
||||
"foreground": "#d16969"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "String interpolation",
|
||||
"scope": [
|
||||
"punctuation.definition.template-expression.begin",
|
||||
"punctuation.definition.template-expression.end",
|
||||
"punctuation.section.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Reset JavaScript string interpolation expression",
|
||||
"scope": [
|
||||
"meta.template.expression"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#ffffff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.type.vendored.property-name",
|
||||
"support.type.property-name",
|
||||
"source.css variable",
|
||||
"source.coffee.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d4d4d4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.control",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.operator",
|
||||
"settings": {
|
||||
"foreground": "#d4d4d4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"keyword.operator.new",
|
||||
"keyword.operator.expression",
|
||||
"keyword.operator.cast",
|
||||
"keyword.operator.sizeof",
|
||||
"keyword.operator.logical.python"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.other.unit",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "support.function.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#d4d4d4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.sha.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "coloring of the Java import and package identifiers",
|
||||
"scope": [
|
||||
"storage.modifier.import.java",
|
||||
"variable.language.wildcard.java",
|
||||
"storage.modifier.package.java"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d4d4d4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "coloring of the TS this",
|
||||
"scope": "variable.language.this",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Function declarations",
|
||||
"scope": [
|
||||
"entity.name.function",
|
||||
"support.function",
|
||||
"support.constant.handlebars",
|
||||
"source.powershell variable.other.member"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#DCDCAA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Types declaration and references",
|
||||
"scope": [
|
||||
"support.class",
|
||||
"support.type",
|
||||
"entity.name.type",
|
||||
"entity.name.namespace",
|
||||
"entity.name.scope-resolution",
|
||||
"entity.name.class",
|
||||
"storage.type.cs",
|
||||
"storage.type.generic.cs",
|
||||
"storage.type.modifier.cs",
|
||||
"storage.type.variable.cs",
|
||||
"storage.type.annotation.java",
|
||||
"storage.type.generic.java",
|
||||
"storage.type.java",
|
||||
"storage.type.object.array.java",
|
||||
"storage.type.primitive.array.java",
|
||||
"storage.type.primitive.java",
|
||||
"storage.type.token.java",
|
||||
"storage.type.groovy",
|
||||
"storage.type.annotation.groovy",
|
||||
"storage.type.parameters.groovy",
|
||||
"storage.type.generic.groovy",
|
||||
"storage.type.object.array.groovy",
|
||||
"storage.type.primitive.array.groovy",
|
||||
"storage.type.primitive.groovy"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Types declaration and references, TS grammar specific",
|
||||
"scope": [
|
||||
"meta.type.cast.expr",
|
||||
"meta.type.new.expr",
|
||||
"support.constant.math",
|
||||
"support.constant.dom",
|
||||
"support.constant.json",
|
||||
"entity.other.inherited-class"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Control flow / Special keywords",
|
||||
"scope": [
|
||||
"keyword.control",
|
||||
"source.cpp keyword.operator.new",
|
||||
"source.cpp keyword.operator.delete",
|
||||
"keyword.other.using",
|
||||
"keyword.other.directive.using",
|
||||
"keyword.other.operator"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#C586C0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Variable and parameter name",
|
||||
"scope": [
|
||||
"variable",
|
||||
"meta.definition.variable.name",
|
||||
"support.variable"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Object keys, TS grammar specific",
|
||||
"scope": [
|
||||
"meta.object-literal.key"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "CSS property value",
|
||||
"scope": [
|
||||
"support.constant.property-value",
|
||||
"support.constant.font-name",
|
||||
"support.constant.media-type",
|
||||
"support.constant.media",
|
||||
"constant.other.color.rgb-value",
|
||||
"constant.other.rgb-value",
|
||||
"support.constant.color"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#CE9178"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "HC Search Editor context line override",
|
||||
"scope": "meta.resultLinePrefix.contextLinePrefix.search",
|
||||
"settings": {
|
||||
"foreground": "#CBEDCB"
|
||||
}
|
||||
}
|
||||
],
|
||||
"semanticHighlighting": true,
|
||||
"semanticTokenColors": {
|
||||
"newOperator": "#FFFFFF",
|
||||
"stringLiteral": "#ce9178",
|
||||
"customLiteral": "#DCDCAA",
|
||||
"numberLiteral": "#b5cea8"
|
||||
}
|
||||
}
|
||||
573
extensions/vscode/builtin-themes/hc_light.json
Normal file
573
extensions/vscode/builtin-themes/hc_light.json
Normal file
|
|
@ -0,0 +1,573 @@
|
|||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Light High Contrast",
|
||||
"tokenColors": [
|
||||
{
|
||||
"scope": [
|
||||
"meta.embedded",
|
||||
"source.groovy.embedded",
|
||||
"variable.legacy.builtin.python"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#292929"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "emphasis",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "strong",
|
||||
"settings": {
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.diff.header",
|
||||
"settings": {
|
||||
"foreground": "#062F4A"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "comment",
|
||||
"settings": {
|
||||
"foreground": "#515151"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.language",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"constant.numeric",
|
||||
"variable.other.enummember",
|
||||
"keyword.operator.plus.exponent",
|
||||
"keyword.operator.minus.exponent"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#096d48"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.regexp",
|
||||
"settings": {
|
||||
"foreground": "#811F3F"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.tag",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.selector",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.other.attribute-name",
|
||||
"settings": {
|
||||
"foreground": "#264F78"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.other.attribute-name.class.css",
|
||||
"source.css entity.other.attribute-name.class",
|
||||
"entity.other.attribute-name.id.css",
|
||||
"entity.other.attribute-name.parent-selector.css",
|
||||
"entity.other.attribute-name.parent.less",
|
||||
"source.css entity.other.attribute-name.pseudo-class",
|
||||
"entity.other.attribute-name.pseudo-element.css",
|
||||
"source.css.less entity.other.attribute-name.id",
|
||||
"entity.other.attribute-name.scss"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "invalid",
|
||||
"settings": {
|
||||
"foreground": "#B5200D"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.underline",
|
||||
"settings": {
|
||||
"fontStyle": "underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.bold",
|
||||
"settings": {
|
||||
"foreground": "#000080",
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.heading",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85",
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.italic",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.strikethrough",
|
||||
"settings": {
|
||||
"fontStyle": "strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inserted",
|
||||
"settings": {
|
||||
"foreground": "#096d48"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.deleted",
|
||||
"settings": {
|
||||
"foreground": "#5A5A5A"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.changed",
|
||||
"settings": {
|
||||
"foreground": "#0451A5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.definition.quote.begin.markdown",
|
||||
"punctuation.definition.list.begin.markdown"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0451A5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inline.raw",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "punctuation.definition.tag",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["meta.preprocessor", "entity.name.function.preprocessor"],
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.string",
|
||||
"settings": {
|
||||
"foreground": "#b5200d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.numeric",
|
||||
"settings": {
|
||||
"foreground": "#096d48"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.structure.dictionary.key.python",
|
||||
"settings": {
|
||||
"foreground": "#0451A5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage.type",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["storage.modifier", "keyword.operator.noexcept"],
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["string", "meta.embedded.assembly"],
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"string.comment.buffered.block.pug",
|
||||
"string.quoted.pug",
|
||||
"string.interpolated.pug",
|
||||
"string.unquoted.plain.in.yaml",
|
||||
"string.unquoted.plain.out.yaml",
|
||||
"string.unquoted.block.yaml",
|
||||
"string.quoted.single.yaml",
|
||||
"string.quoted.double.xml",
|
||||
"string.quoted.single.xml",
|
||||
"string.unquoted.cdata.xml",
|
||||
"string.quoted.double.html",
|
||||
"string.quoted.single.html",
|
||||
"string.unquoted.html",
|
||||
"string.quoted.single.handlebars",
|
||||
"string.quoted.double.handlebars"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.regexp",
|
||||
"settings": {
|
||||
"foreground": "#811F3F"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.definition.template-expression.begin",
|
||||
"punctuation.definition.template-expression.end",
|
||||
"punctuation.section.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["meta.template.expression"],
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.constant.property-value",
|
||||
"support.constant.font-name",
|
||||
"support.constant.media-type",
|
||||
"support.constant.media",
|
||||
"constant.other.color.rgb-value",
|
||||
"constant.other.rgb-value",
|
||||
"support.constant.color"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0451A5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.type.vendored.property-name",
|
||||
"support.type.property-name",
|
||||
"source.css variable",
|
||||
"source.coffee.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#264F78"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["support.type.property-name.json"],
|
||||
"settings": {
|
||||
"foreground": "#0451A5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.control",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.operator",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"keyword.operator.new",
|
||||
"keyword.operator.expression",
|
||||
"keyword.operator.cast",
|
||||
"keyword.operator.sizeof",
|
||||
"keyword.operator.alignof",
|
||||
"keyword.operator.typeid",
|
||||
"keyword.operator.alignas",
|
||||
"keyword.operator.instanceof",
|
||||
"keyword.operator.logical.python",
|
||||
"keyword.operator.wordlike"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.other.unit",
|
||||
"settings": {
|
||||
"foreground": "#096d48"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.section.embedded.begin.php",
|
||||
"punctuation.section.embedded.end.php"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "support.function.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#0451A5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.sha.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#096d48"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"storage.modifier.import.java",
|
||||
"variable.language.wildcard.java",
|
||||
"storage.modifier.package.java"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.language",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.name.function",
|
||||
"support.function",
|
||||
"support.constant.handlebars",
|
||||
"source.powershell variable.other.member",
|
||||
"entity.name.operator.custom-literal"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#5e2cbc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.class",
|
||||
"support.type",
|
||||
"entity.name.type",
|
||||
"entity.name.namespace",
|
||||
"entity.other.attribute",
|
||||
"entity.name.scope-resolution",
|
||||
"entity.name.class",
|
||||
"storage.type.numeric.go",
|
||||
"storage.type.byte.go",
|
||||
"storage.type.boolean.go",
|
||||
"storage.type.string.go",
|
||||
"storage.type.uintptr.go",
|
||||
"storage.type.error.go",
|
||||
"storage.type.rune.go",
|
||||
"storage.type.cs",
|
||||
"storage.type.generic.cs",
|
||||
"storage.type.modifier.cs",
|
||||
"storage.type.variable.cs",
|
||||
"storage.type.annotation.java",
|
||||
"storage.type.generic.java",
|
||||
"storage.type.java",
|
||||
"storage.type.object.array.java",
|
||||
"storage.type.primitive.array.java",
|
||||
"storage.type.primitive.java",
|
||||
"storage.type.token.java",
|
||||
"storage.type.groovy",
|
||||
"storage.type.annotation.groovy",
|
||||
"storage.type.parameters.groovy",
|
||||
"storage.type.generic.groovy",
|
||||
"storage.type.object.array.groovy",
|
||||
"storage.type.primitive.array.groovy",
|
||||
"storage.type.primitive.groovy"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#185E73"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"meta.type.cast.expr",
|
||||
"meta.type.new.expr",
|
||||
"support.constant.math",
|
||||
"support.constant.dom",
|
||||
"support.constant.json",
|
||||
"entity.other.inherited-class"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#185E73"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"keyword.control",
|
||||
"source.cpp keyword.operator.new",
|
||||
"source.cpp keyword.operator.delete",
|
||||
"keyword.other.using",
|
||||
"keyword.other.directive.using",
|
||||
"keyword.other.operator",
|
||||
"entity.name.operator"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#b5200d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"variable",
|
||||
"meta.definition.variable.name",
|
||||
"support.variable",
|
||||
"entity.name.variable",
|
||||
"constant.other.placeholder"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#001080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["variable.other.constant", "variable.other.enummember"],
|
||||
"settings": {
|
||||
"foreground": "#02715D"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["meta.object-literal.key"],
|
||||
"settings": {
|
||||
"foreground": "#001080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.constant.property-value",
|
||||
"support.constant.font-name",
|
||||
"support.constant.media-type",
|
||||
"support.constant.media",
|
||||
"constant.other.color.rgb-value",
|
||||
"constant.other.rgb-value",
|
||||
"support.constant.color"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0451A5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.definition.group.regexp",
|
||||
"punctuation.definition.group.assertion.regexp",
|
||||
"punctuation.definition.character-class.regexp",
|
||||
"punctuation.character.set.begin.regexp",
|
||||
"punctuation.character.set.end.regexp",
|
||||
"keyword.operator.negation.regexp",
|
||||
"support.other.parenthesis.regexp"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#D16969"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"constant.character.character-class.regexp",
|
||||
"constant.other.character-class.set.regexp",
|
||||
"constant.other.character-class.regexp",
|
||||
"constant.character.set.regexp"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#811F3F"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.operator.quantifier.regexp",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["keyword.operator.or.regexp", "keyword.control.anchor.regexp"],
|
||||
"settings": {
|
||||
"foreground": "#EE0000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.character",
|
||||
"settings": {
|
||||
"foreground": "#0F4A85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.character.escape",
|
||||
"settings": {
|
||||
"foreground": "#EE0000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.label",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "token.info-token",
|
||||
"settings": {
|
||||
"foreground": "#316BCD"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "token.warn-token",
|
||||
"settings": {
|
||||
"foreground": "#CD9731"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "token.error-token",
|
||||
"settings": {
|
||||
"foreground": "#CD3131"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "token.debug-token",
|
||||
"settings": {
|
||||
"foreground": "#800080"
|
||||
}
|
||||
}
|
||||
],
|
||||
"colors": {
|
||||
"actionBar.toggledBackground": "#dddddd"
|
||||
}
|
||||
}
|
||||
145
extensions/vscode/builtin-themes/light_modern.json
Normal file
145
extensions/vscode/builtin-themes/light_modern.json
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Default Light Modern",
|
||||
"include": "./light_plus.json",
|
||||
"colors": {
|
||||
"activityBar.activeBorder": "#005FB8",
|
||||
"activityBar.background": "#F8F8F8",
|
||||
"activityBar.border": "#E5E5E5",
|
||||
"activityBar.foreground": "#1F1F1F",
|
||||
"activityBar.inactiveForeground": "#616161",
|
||||
"activityBarBadge.background": "#005FB8",
|
||||
"activityBarBadge.foreground": "#FFFFFF",
|
||||
"badge.background": "#CCCCCC",
|
||||
"badge.foreground": "#3B3B3B",
|
||||
"button.background": "#005FB8",
|
||||
"button.border": "#0000001a",
|
||||
"button.foreground": "#FFFFFF",
|
||||
"button.hoverBackground": "#0258A8",
|
||||
"button.secondaryBackground": "#E5E5E5",
|
||||
"button.secondaryForeground": "#3B3B3B",
|
||||
"button.secondaryHoverBackground": "#CCCCCC",
|
||||
"chat.slashCommandBackground": "#D2ECFF",
|
||||
"chat.slashCommandForeground": "#306CA2",
|
||||
"checkbox.background": "#F8F8F8",
|
||||
"checkbox.border": "#CECECE",
|
||||
"descriptionForeground": "#3B3B3B",
|
||||
"dropdown.background": "#FFFFFF",
|
||||
"dropdown.border": "#CECECE",
|
||||
"dropdown.foreground": "#3B3B3B",
|
||||
"dropdown.listBackground": "#FFFFFF",
|
||||
"editor.background": "#FFFFFF",
|
||||
"editor.foreground": "#3B3B3B",
|
||||
"editor.inactiveSelectionBackground": "#E5EBF1",
|
||||
"editor.selectionHighlightBackground": "#ADD6FF80",
|
||||
"editorGroup.border": "#E5E5E5",
|
||||
"editorGroupHeader.tabsBackground": "#F8F8F8",
|
||||
"editorGroupHeader.tabsBorder": "#E5E5E5",
|
||||
"editorGutter.addedBackground": "#2EA043",
|
||||
"editorGutter.deletedBackground": "#F85149",
|
||||
"editorGutter.modifiedBackground": "#005FB8",
|
||||
"editorIndentGuide.background1": "#D3D3D3",
|
||||
"editorLineNumber.activeForeground": "#171184",
|
||||
"editorLineNumber.foreground": "#6E7681",
|
||||
"editorOverviewRuler.border": "#E5E5E5",
|
||||
"editorSuggestWidget.background": "#F8F8F8",
|
||||
"editorWidget.background": "#F8F8F8",
|
||||
"errorForeground": "#F85149",
|
||||
"focusBorder": "#005FB8",
|
||||
"foreground": "#3B3B3B",
|
||||
"icon.foreground": "#3B3B3B",
|
||||
"input.background": "#FFFFFF",
|
||||
"input.border": "#CECECE",
|
||||
"input.foreground": "#3B3B3B",
|
||||
"input.placeholderForeground": "#767676",
|
||||
"inputOption.activeBackground": "#BED6ED",
|
||||
"inputOption.activeBorder": "#005FB8",
|
||||
"inputOption.activeForeground": "#000000",
|
||||
"keybindingLabel.foreground": "#3B3B3B",
|
||||
"list.activeSelectionBackground": "#E8E8E8",
|
||||
"list.activeSelectionForeground": "#000000",
|
||||
"list.activeSelectionIconForeground": "#000000",
|
||||
"list.hoverBackground": "#F2F2F2",
|
||||
"list.focusAndSelectionOutline": "#005FB8",
|
||||
"menu.border": "#CECECE",
|
||||
"notebook.cellBorderColor": "#E5E5E5",
|
||||
"notebook.selectedCellBackground": "#C8DDF150",
|
||||
"notificationCenterHeader.background": "#FFFFFF",
|
||||
"notificationCenterHeader.foreground": "#3B3B3B",
|
||||
"notifications.background": "#FFFFFF",
|
||||
"notifications.border": "#E5E5E5",
|
||||
"notifications.foreground": "#3B3B3B",
|
||||
"panel.background": "#F8F8F8",
|
||||
"panel.border": "#E5E5E5",
|
||||
"panelInput.border": "#E5E5E5",
|
||||
"panelTitle.activeBorder": "#005FB8",
|
||||
"panelTitle.activeForeground": "#3B3B3B",
|
||||
"panelTitle.inactiveForeground": "#3B3B3B",
|
||||
"peekViewEditor.matchHighlightBackground": "#BB800966",
|
||||
"peekViewResult.background": "#FFFFFF",
|
||||
"peekViewResult.matchHighlightBackground": "#BB800966",
|
||||
"pickerGroup.border": "#E5E5E5",
|
||||
"pickerGroup.foreground": "#8B949E",
|
||||
"ports.iconRunningProcessForeground": "#369432",
|
||||
"progressBar.background": "#005FB8",
|
||||
"quickInput.background": "#F8F8F8",
|
||||
"quickInput.foreground": "#3B3B3B",
|
||||
"searchEditor.textInputBorder": "#CECECE",
|
||||
"settings.dropdownBackground": "#FFFFFF",
|
||||
"settings.dropdownBorder": "#CECECE",
|
||||
"settings.headerForeground": "#1F1F1F",
|
||||
"settings.modifiedItemIndicator": "#BB800966",
|
||||
"settings.numberInputBorder": "#CECECE",
|
||||
"settings.textInputBorder": "#CECECE",
|
||||
"sideBar.background": "#F8F8F8",
|
||||
"sideBar.border": "#E5E5E5",
|
||||
"sideBar.foreground": "#3B3B3B",
|
||||
"sideBarSectionHeader.background": "#F8F8F8",
|
||||
"sideBarSectionHeader.border": "#E5E5E5",
|
||||
"sideBarSectionHeader.foreground": "#3B3B3B",
|
||||
"sideBarTitle.foreground": "#3B3B3B",
|
||||
"statusBar.background": "#F8F8F8",
|
||||
"statusBar.foreground": "#3B3B3B",
|
||||
"statusBar.border": "#E5E5E5",
|
||||
"statusBar.debuggingBackground": "#FD716C",
|
||||
"statusBar.debuggingForeground": "#000000",
|
||||
"statusBar.focusBorder": "#005FB8",
|
||||
"statusBar.noFolderBackground": "#F8F8F8",
|
||||
"statusBarItem.errorBackground": "#C72E0F",
|
||||
"statusBarItem.focusBorder": "#005FB8",
|
||||
"statusBarItem.prominentBackground": "#6E768166",
|
||||
"statusBarItem.remoteBackground": "#005FB8",
|
||||
"statusBarItem.remoteForeground": "#FFFFFF",
|
||||
"tab.activeBackground": "#FFFFFF",
|
||||
"tab.activeBorder": "#F8F8F8",
|
||||
"tab.activeBorderTop": "#005FB8",
|
||||
"tab.activeForeground": "#3B3B3B",
|
||||
"tab.border": "#E5E5E5",
|
||||
"tab.hoverBackground": "#FFFFFF",
|
||||
"tab.inactiveBackground": "#F8F8F8",
|
||||
"tab.inactiveForeground": "#868686",
|
||||
"tab.lastPinnedBorder": "#D4D4D4",
|
||||
"tab.unfocusedActiveBorder": "#F8F8F8",
|
||||
"tab.unfocusedActiveBorderTop": "#E5E5E5",
|
||||
"tab.unfocusedHoverBackground": "#F8F8F8",
|
||||
"terminalCursor.foreground": "#005FB8",
|
||||
"terminal.foreground": "#3B3B3B",
|
||||
"terminal.inactiveSelectionBackground": "#E5EBF1",
|
||||
"terminal.tab.activeBorder": "#005FB8",
|
||||
"textBlockQuote.background": "#F8F8F8",
|
||||
"textBlockQuote.border": "#E5E5E5",
|
||||
"textCodeBlock.background": "#F8F8F8",
|
||||
"textLink.activeForeground": "#005FB8",
|
||||
"textLink.foreground": "#005FB8",
|
||||
"textPreformat.foreground": "#3B3B3B",
|
||||
"textPreformat.background": "#0000001F",
|
||||
"textSeparator.foreground": "#21262D",
|
||||
"titleBar.activeBackground": "#F8F8F8",
|
||||
"titleBar.activeForeground": "#1E1E1E",
|
||||
"titleBar.border": "#E5E5E5",
|
||||
"titleBar.inactiveBackground": "#F8F8F8",
|
||||
"titleBar.inactiveForeground": "#8B949E",
|
||||
"welcomePage.tileBackground": "#F3F3F3",
|
||||
"widget.border": "#E5E5E5"
|
||||
}
|
||||
}
|
||||
194
extensions/vscode/builtin-themes/light_plus.json
Normal file
194
extensions/vscode/builtin-themes/light_plus.json
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Light+",
|
||||
"include": "./light_vs.json",
|
||||
"tokenColors": [
|
||||
{
|
||||
"name": "Function declarations",
|
||||
"scope": [
|
||||
"entity.name.function",
|
||||
"support.function",
|
||||
"support.constant.handlebars",
|
||||
"source.powershell variable.other.member",
|
||||
"entity.name.operator.custom-literal"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#795E26"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Types declaration and references",
|
||||
"scope": [
|
||||
"support.class",
|
||||
"support.type",
|
||||
"entity.name.type",
|
||||
"entity.name.namespace",
|
||||
"entity.other.attribute",
|
||||
"entity.name.scope-resolution",
|
||||
"entity.name.class",
|
||||
"storage.type.numeric.go",
|
||||
"storage.type.byte.go",
|
||||
"storage.type.boolean.go",
|
||||
"storage.type.string.go",
|
||||
"storage.type.uintptr.go",
|
||||
"storage.type.error.go",
|
||||
"storage.type.rune.go",
|
||||
"storage.type.cs",
|
||||
"storage.type.generic.cs",
|
||||
"storage.type.modifier.cs",
|
||||
"storage.type.variable.cs",
|
||||
"storage.type.annotation.java",
|
||||
"storage.type.generic.java",
|
||||
"storage.type.java",
|
||||
"storage.type.object.array.java",
|
||||
"storage.type.primitive.array.java",
|
||||
"storage.type.primitive.java",
|
||||
"storage.type.token.java",
|
||||
"storage.type.groovy",
|
||||
"storage.type.annotation.groovy",
|
||||
"storage.type.parameters.groovy",
|
||||
"storage.type.generic.groovy",
|
||||
"storage.type.object.array.groovy",
|
||||
"storage.type.primitive.array.groovy",
|
||||
"storage.type.primitive.groovy"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#267f99"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Types declaration and references, TS grammar specific",
|
||||
"scope": [
|
||||
"meta.type.cast.expr",
|
||||
"meta.type.new.expr",
|
||||
"support.constant.math",
|
||||
"support.constant.dom",
|
||||
"support.constant.json",
|
||||
"entity.other.inherited-class"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#267f99"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Control flow / Special keywords",
|
||||
"scope": [
|
||||
"keyword.control",
|
||||
"source.cpp keyword.operator.new",
|
||||
"source.cpp keyword.operator.delete",
|
||||
"keyword.other.using",
|
||||
"keyword.other.directive.using",
|
||||
"keyword.other.operator",
|
||||
"entity.name.operator"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#AF00DB"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Variable and parameter name",
|
||||
"scope": [
|
||||
"variable",
|
||||
"meta.definition.variable.name",
|
||||
"support.variable",
|
||||
"entity.name.variable",
|
||||
"constant.other.placeholder"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#001080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Constants and enums",
|
||||
"scope": ["variable.other.constant", "variable.other.enummember"],
|
||||
"settings": {
|
||||
"foreground": "#0070C1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Object keys, TS grammar specific",
|
||||
"scope": ["meta.object-literal.key"],
|
||||
"settings": {
|
||||
"foreground": "#001080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "CSS property value",
|
||||
"scope": [
|
||||
"support.constant.property-value",
|
||||
"support.constant.font-name",
|
||||
"support.constant.media-type",
|
||||
"support.constant.media",
|
||||
"constant.other.color.rgb-value",
|
||||
"constant.other.rgb-value",
|
||||
"support.constant.color"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Regular expression groups",
|
||||
"scope": [
|
||||
"punctuation.definition.group.regexp",
|
||||
"punctuation.definition.group.assertion.regexp",
|
||||
"punctuation.definition.character-class.regexp",
|
||||
"punctuation.character.set.begin.regexp",
|
||||
"punctuation.character.set.end.regexp",
|
||||
"keyword.operator.negation.regexp",
|
||||
"support.other.parenthesis.regexp"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d16969"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"constant.character.character-class.regexp",
|
||||
"constant.other.character-class.set.regexp",
|
||||
"constant.other.character-class.regexp",
|
||||
"constant.character.set.regexp"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#811f3f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.operator.quantifier.regexp",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["keyword.operator.or.regexp", "keyword.control.anchor.regexp"],
|
||||
"settings": {
|
||||
"foreground": "#EE0000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["constant.character", "constant.other.option"],
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.character.escape",
|
||||
"settings": {
|
||||
"foreground": "#EE0000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.label",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
}
|
||||
],
|
||||
"semanticHighlighting": true,
|
||||
"semanticTokenColors": {
|
||||
"newOperator": "#AF00DB",
|
||||
"stringLiteral": "#a31515",
|
||||
"customLiteral": "#795E26",
|
||||
"numberLiteral": "#098658"
|
||||
}
|
||||
}
|
||||
422
extensions/vscode/builtin-themes/light_vs.json
Normal file
422
extensions/vscode/builtin-themes/light_vs.json
Normal file
|
|
@ -0,0 +1,422 @@
|
|||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Light (Visual Studio)",
|
||||
"colors": {
|
||||
"checkbox.border": "#919191",
|
||||
"editor.background": "#FFFFFF",
|
||||
"editor.foreground": "#000000",
|
||||
"editor.inactiveSelectionBackground": "#E5EBF1",
|
||||
"editorIndentGuide.background1": "#D3D3D3",
|
||||
"editorIndentGuide.activeBackground1": "#939393",
|
||||
"editor.selectionHighlightBackground": "#ADD6FF80",
|
||||
"editorSuggestWidget.background": "#F3F3F3",
|
||||
"activityBarBadge.background": "#007ACC",
|
||||
"sideBarTitle.foreground": "#6F6F6F",
|
||||
"list.hoverBackground": "#E8E8E8",
|
||||
"menu.border": "#D4D4D4",
|
||||
"input.placeholderForeground": "#767676",
|
||||
"searchEditor.textInputBorder": "#CECECE",
|
||||
"settings.textInputBorder": "#CECECE",
|
||||
"settings.numberInputBorder": "#CECECE",
|
||||
"statusBarItem.remoteForeground": "#FFF",
|
||||
"statusBarItem.remoteBackground": "#16825D",
|
||||
"ports.iconRunningProcessForeground": "#369432",
|
||||
"sideBarSectionHeader.background": "#0000",
|
||||
"sideBarSectionHeader.border": "#61616130",
|
||||
"tab.lastPinnedBorder": "#61616130",
|
||||
"notebook.cellBorderColor": "#E8E8E8",
|
||||
"notebook.selectedCellBackground": "#c8ddf150",
|
||||
"statusBarItem.errorBackground": "#c72e0f",
|
||||
"list.activeSelectionIconForeground": "#FFF",
|
||||
"list.focusAndSelectionOutline": "#90C2F9",
|
||||
"terminal.inactiveSelectionBackground": "#E5EBF1",
|
||||
"widget.border": "#d4d4d4",
|
||||
"actionBar.toggledBackground": "#dddddd",
|
||||
"diffEditor.unchangedRegionBackground": "#f8f8f8"
|
||||
},
|
||||
"tokenColors": [
|
||||
{
|
||||
"scope": [
|
||||
"meta.embedded",
|
||||
"source.groovy.embedded",
|
||||
"string meta.image.inline.markdown",
|
||||
"variable.legacy.builtin.python"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#000000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "emphasis",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "strong",
|
||||
"settings": {
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.diff.header",
|
||||
"settings": {
|
||||
"foreground": "#000080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "comment",
|
||||
"settings": {
|
||||
"foreground": "#008000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.language",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"constant.numeric",
|
||||
"variable.other.enummember",
|
||||
"keyword.operator.plus.exponent",
|
||||
"keyword.operator.minus.exponent"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#098658"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.regexp",
|
||||
"settings": {
|
||||
"foreground": "#811f3f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "css tags in selectors, xml tags",
|
||||
"scope": "entity.name.tag",
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.selector",
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.other.attribute-name",
|
||||
"settings": {
|
||||
"foreground": "#e50000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.other.attribute-name.class.css",
|
||||
"source.css entity.other.attribute-name.class",
|
||||
"entity.other.attribute-name.id.css",
|
||||
"entity.other.attribute-name.parent-selector.css",
|
||||
"entity.other.attribute-name.parent.less",
|
||||
"source.css entity.other.attribute-name.pseudo-class",
|
||||
"entity.other.attribute-name.pseudo-element.css",
|
||||
"source.css.less entity.other.attribute-name.id",
|
||||
"entity.other.attribute-name.scss"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "invalid",
|
||||
"settings": {
|
||||
"foreground": "#cd3131"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.underline",
|
||||
"settings": {
|
||||
"fontStyle": "underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.bold",
|
||||
"settings": {
|
||||
"fontStyle": "bold",
|
||||
"foreground": "#000080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.heading",
|
||||
"settings": {
|
||||
"fontStyle": "bold",
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.italic",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.strikethrough",
|
||||
"settings": {
|
||||
"fontStyle": "strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inserted",
|
||||
"settings": {
|
||||
"foreground": "#098658"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.deleted",
|
||||
"settings": {
|
||||
"foreground": "#a31515"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.changed",
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.definition.quote.begin.markdown",
|
||||
"punctuation.definition.list.begin.markdown"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inline.raw",
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "brackets of XML/HTML tags",
|
||||
"scope": "punctuation.definition.tag",
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["meta.preprocessor", "entity.name.function.preprocessor"],
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.string",
|
||||
"settings": {
|
||||
"foreground": "#a31515"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.numeric",
|
||||
"settings": {
|
||||
"foreground": "#098658"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.structure.dictionary.key.python",
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage.type",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["storage.modifier", "keyword.operator.noexcept"],
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["string", "meta.embedded.assembly"],
|
||||
"settings": {
|
||||
"foreground": "#a31515"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"string.comment.buffered.block.pug",
|
||||
"string.quoted.pug",
|
||||
"string.interpolated.pug",
|
||||
"string.unquoted.plain.in.yaml",
|
||||
"string.unquoted.plain.out.yaml",
|
||||
"string.unquoted.block.yaml",
|
||||
"string.quoted.single.yaml",
|
||||
"string.quoted.double.xml",
|
||||
"string.quoted.single.xml",
|
||||
"string.unquoted.cdata.xml",
|
||||
"string.quoted.double.html",
|
||||
"string.quoted.single.html",
|
||||
"string.unquoted.html",
|
||||
"string.quoted.single.handlebars",
|
||||
"string.quoted.double.handlebars"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.regexp",
|
||||
"settings": {
|
||||
"foreground": "#811f3f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "String interpolation",
|
||||
"scope": [
|
||||
"punctuation.definition.template-expression.begin",
|
||||
"punctuation.definition.template-expression.end",
|
||||
"punctuation.section.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Reset JavaScript string interpolation expression",
|
||||
"scope": ["meta.template.expression"],
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.constant.property-value",
|
||||
"support.constant.font-name",
|
||||
"support.constant.media-type",
|
||||
"support.constant.media",
|
||||
"constant.other.color.rgb-value",
|
||||
"constant.other.rgb-value",
|
||||
"support.constant.color"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.type.vendored.property-name",
|
||||
"support.type.property-name",
|
||||
"source.css variable",
|
||||
"source.coffee.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#e50000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": ["support.type.property-name.json"],
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.control",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.operator",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"keyword.operator.new",
|
||||
"keyword.operator.expression",
|
||||
"keyword.operator.cast",
|
||||
"keyword.operator.sizeof",
|
||||
"keyword.operator.alignof",
|
||||
"keyword.operator.typeid",
|
||||
"keyword.operator.alignas",
|
||||
"keyword.operator.instanceof",
|
||||
"keyword.operator.logical.python",
|
||||
"keyword.operator.wordlike"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.other.unit",
|
||||
"settings": {
|
||||
"foreground": "#098658"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.section.embedded.begin.php",
|
||||
"punctuation.section.embedded.end.php"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "support.function.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.sha.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#098658"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "coloring of the Java import and package identifiers",
|
||||
"scope": [
|
||||
"storage.modifier.import.java",
|
||||
"variable.language.wildcard.java",
|
||||
"storage.modifier.package.java"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "this.self",
|
||||
"scope": "variable.language",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
}
|
||||
],
|
||||
"semanticHighlighting": true,
|
||||
"semanticTokenColors": {
|
||||
"newOperator": "#0000ff",
|
||||
"stringLiteral": "#a31515",
|
||||
"customLiteral": "#000000",
|
||||
"numberLiteral": "#098658"
|
||||
}
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
"timeout": {
|
||||
"title": "Timeout",
|
||||
"description": "Set the timeout for each request to the LLM. If you are running a local LLM that takes a while to respond, you might want to set this to avoid timeouts.",
|
||||
"default": 300,
|
||||
"default": 7200,
|
||||
"type": "integer"
|
||||
},
|
||||
"verifySsl": {
|
||||
|
|
@ -212,7 +212,7 @@
|
|||
"title": "Request Options",
|
||||
"description": "Options for the HTTP request to the LLM.",
|
||||
"default": {
|
||||
"timeout": 300,
|
||||
"timeout": 7200,
|
||||
"verifySsl": null,
|
||||
"caBundlePath": null,
|
||||
"proxy": null,
|
||||
|
|
@ -435,10 +435,13 @@
|
|||
"wizardcoder-34b",
|
||||
"zephyr-7b",
|
||||
"codeup-13b",
|
||||
"deepseek-1b",
|
||||
"deepseek-7b",
|
||||
"deepseek-33b",
|
||||
"neural-chat-7b"
|
||||
"neural-chat-7b",
|
||||
"deepseek-1b",
|
||||
"stable-code-3b",
|
||||
"starcoder-1b",
|
||||
"starcoder-3b"
|
||||
]
|
||||
},
|
||||
{ "type": "string" }
|
||||
|
|
@ -569,10 +572,13 @@
|
|||
"wizardcoder-34b",
|
||||
"zephyr-7b",
|
||||
"codeup-13b",
|
||||
"deepseek-1b",
|
||||
"deepseek-7b",
|
||||
"deepseek-33b",
|
||||
"neural-chat-7b"
|
||||
"neural-chat-7b",
|
||||
"deepseek-1b",
|
||||
"stable-code-3b",
|
||||
"starcoder-1b",
|
||||
"starcoder-3b"
|
||||
]
|
||||
},
|
||||
{ "type": "string" }
|
||||
|
|
@ -610,10 +616,13 @@
|
|||
"wizardcoder-34b",
|
||||
"zephyr-7b",
|
||||
"codeup-13b",
|
||||
"deepseek-1b",
|
||||
"deepseek-7b",
|
||||
"deepseek-33b",
|
||||
"neural-chat-7b"
|
||||
"neural-chat-7b",
|
||||
"deepseek-1b",
|
||||
"stable-code-3b",
|
||||
"starcoder-1b",
|
||||
"starcoder-3b"
|
||||
]
|
||||
},
|
||||
{ "type": "string" }
|
||||
|
|
@ -785,7 +794,6 @@
|
|||
"wizardcoder-34b",
|
||||
"zephyr-7b",
|
||||
"codeup-13b",
|
||||
"deepseek-1b",
|
||||
"deepseek-7b",
|
||||
"deepseek-33b",
|
||||
"claude-2",
|
||||
|
|
@ -793,7 +801,11 @@
|
|||
"gemini-pro",
|
||||
"mistral-tiny",
|
||||
"mistral-small",
|
||||
"mistral-medium"
|
||||
"mistral-medium",
|
||||
"deepseek-1b",
|
||||
"stable-code-3b",
|
||||
"starcoder-1b",
|
||||
"starcoder-3b"
|
||||
]
|
||||
},
|
||||
{ "type": "string" }
|
||||
|
|
@ -985,7 +997,8 @@
|
|||
"Reference GitHub issues from a repository",
|
||||
"Retrieve important pages from a documentation website, as determined by similarity search",
|
||||
"Index and retrieve the contents of any documentation site, using embeddings to find important snippets",
|
||||
"Display a file tree of the current workspace"
|
||||
"Display a file tree of the current workspace",
|
||||
"Include a repo map showing important code objects"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
@ -1295,6 +1308,51 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"tabAutocompleteModel": {
|
||||
"title": "Tab Autocomplete Model",
|
||||
"markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using deepseek-coder:1.3b-base on a local Ollama instance.",
|
||||
"default": {
|
||||
"title": "Tab Autocomplete Model",
|
||||
"provider": "ollama",
|
||||
"model": "deepseek-coder:1.3b-base"
|
||||
},
|
||||
"$ref": "#/definitions/ModelDescription"
|
||||
},
|
||||
"tabAutocompleteOptions": {
|
||||
"title": "TabAutocompleteOptions",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"useCopyBuffer": {
|
||||
"type": "boolean",
|
||||
"description": "Determines whether the copy buffer will be considered when contructing the prompt."
|
||||
},
|
||||
"useSuffix": {
|
||||
"type": "boolean",
|
||||
"description": "Determines whether to use the file suffix in the prompt."
|
||||
},
|
||||
"maxPromptTokens": {
|
||||
"type": "number",
|
||||
"description": "The maximum number of prompt tokens to use. A smaller number will yield faster completions, but less context."
|
||||
},
|
||||
"debounceDelay": {
|
||||
"type": "number",
|
||||
"description": "The delay in milliseconds before triggering autocomplete after a keystroke."
|
||||
},
|
||||
"maxSuffixPercentage": {
|
||||
"type": "number",
|
||||
"description": "The maximum percentage of the prompt that can be dedicated to the suffix."
|
||||
},
|
||||
"prefixPercentage": {
|
||||
"type": "number",
|
||||
"description": "The percentage of the input that should be dedicated to the prefix."
|
||||
},
|
||||
"template": {
|
||||
"type": "string",
|
||||
"description": "An optional template string to be used for autocomplete. It will be rendered with the Mustache templating language, and is passed the 'prefix' and 'suffix' variables."
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
extensions/vscode/gui/onigasm.wasm
Normal file
BIN
extensions/vscode/gui/onigasm.wasm
Normal file
Binary file not shown.
|
|
@ -1,3 +1,13 @@
|
|||
function mergeSortAlgorithm(arr) {
|
||||
// TODO
|
||||
}
|
||||
import { factorial, repeat } from "./factorial";
|
||||
|
||||
function fib(n) {
|
||||
if (n <= 1) return n;
|
||||
return fib(n - 2) + fib(n - 1);
|
||||
}
|
||||
|
||||
let d = repeat(5, "a");
|
||||
console.log(d);
|
||||
|
||||
let e = factorial(3);
|
||||
console.log(e);
|
||||
|
||||
|
|
|
|||
8
extensions/vscode/manual-testing-sandbox/factorial.ts
Normal file
8
extensions/vscode/manual-testing-sandbox/factorial.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export function factorial(n) {
|
||||
if (n <= 1) return 1;
|
||||
return n * factorial(n - 1);
|
||||
}
|
||||
|
||||
export function repeat(n: number, a: string) {
|
||||
return a.repeat(n);
|
||||
}
|
||||
BIN
extensions/vscode/media/above-line-edit.gif
Normal file
BIN
extensions/vscode/media/above-line-edit.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 MiB |
BIN
extensions/vscode/media/autocomplete.gif
Normal file
BIN
extensions/vscode/media/autocomplete.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
BIN
extensions/vscode/media/image.gif
Normal file
BIN
extensions/vscode/media/image.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 MiB |
BIN
extensions/vscode/media/scratch.gif
Normal file
BIN
extensions/vscode/media/scratch.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
BIN
extensions/vscode/media/sidebar.gif
Normal file
BIN
extensions/vscode/media/sidebar.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 755 KiB |
|
|
@ -1 +0,0 @@
|
|||
# Welcome to Continue
|
||||
17
extensions/vscode/media/welcome.md
Normal file
17
extensions/vscode/media/welcome.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# 👋 Welcome to Continue
|
||||
|
||||
## ❗️ Before you get started
|
||||
|
||||
Continue is currently in the left sidebar, but we recommend moving it to the right. This way it won't cover your file explorer. You can move it back at any time.
|
||||
|
||||

|
||||
|
||||
## 🔑 Most important shortcuts
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>M</kbd> = Select code
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>M</kbd> = Select code for follow-up
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>L</kbd> = Quick edit
|
||||
|
||||
<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>R</kbd> = Automatically debug terminal
|
||||
2451
extensions/vscode/package-lock.json
generated
2451
extensions/vscode/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -22,7 +22,7 @@
|
|||
"description": "Open-source autopilot for software development - bring the power of ChatGPT to your IDE",
|
||||
"publisher": "Continue",
|
||||
"engines": {
|
||||
"vscode": "^1.67.0"
|
||||
"vscode": "^1.70.0"
|
||||
},
|
||||
"galleryBanner": {
|
||||
"color": "#1E1E1E",
|
||||
|
|
@ -55,17 +55,17 @@
|
|||
"continue.telemetryEnabled": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Continue collects anonymous usage data, cleaned of PII, to help us improve the product for our users. Read more at https://continue.dev/docs/telemetry."
|
||||
"markdownDescription": "Continue collects anonymous usage data, cleaned of PII, to help us improve the product for our users. Read more at [continue.dev › Telemetry](https://continue.dev/docs/telemetry)."
|
||||
},
|
||||
"continue.showInlineTip": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Show inline suggestion to use the Continue keyboard shortcuts."
|
||||
},
|
||||
"continue.proxyServerUrl": {
|
||||
"type": "string",
|
||||
"default": "http://localhost:65433",
|
||||
"description": "An optional proxy server URL through which you can route all Continue requests. Do not change this unless you have set up your own server to proxy requests."
|
||||
"continue.enableTabAutocomplete": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"markdownDescription": "Enable Continue's experimental tab autocomplete feature. Read our walkthrough to learn about configuration and how to share feedback: [continue.dev › Walkthrough: Tab Autocomplete](https://continue.dev/docs/walkthroughs/tab-autocomplete)"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -427,10 +427,9 @@
|
|||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/glob": "^8.0.0",
|
||||
"@types/node": "16.x",
|
||||
"@types/node-fetch": "^2.6.2",
|
||||
"@types/react-dom": "^18.2.4",
|
||||
"@types/request": "^2.48.8",
|
||||
"@types/vscode": "1.67",
|
||||
"@types/vscode": "1.70",
|
||||
"@types/ws": "^8.5.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
|
|
@ -451,6 +450,7 @@
|
|||
"@electron/rebuild": "^3.2.10",
|
||||
"@reduxjs/toolkit": "^1.9.3",
|
||||
"@types/jest": "^29.5.11",
|
||||
"@types/node-fetch": "^2.6.11",
|
||||
"@vscode/ripgrep": "^1.15.9",
|
||||
"axios": "^1.2.5",
|
||||
"core": "file:../../core",
|
||||
|
|
@ -459,13 +459,19 @@
|
|||
"express": "^4.18.2",
|
||||
"fkill": "^8.1.0",
|
||||
"follow-redirects": "^1.15.4",
|
||||
"handlebars": "^4.7.8",
|
||||
"highlight.js": "^11.7.0",
|
||||
"highlightable": "^1.3.0-beta.0",
|
||||
"http-proxy": "^1.18.1",
|
||||
"http-proxy-agent": "^7.0.0",
|
||||
"http-proxy-middleware": "^2.0.6",
|
||||
"https-proxy-agent": "^7.0.2",
|
||||
"ignore": "^5.3.0",
|
||||
"jest": "^29.7.0",
|
||||
"monaco-editor": "^0.45.0",
|
||||
"monaco-vscode-textmate-theme-converter": "^0.1.7",
|
||||
"ncp": "^2.0.0",
|
||||
"node-fetch": "^3.3.2",
|
||||
"node-machine-id": "^1.1.12",
|
||||
"posthog-node": "^3.1.2",
|
||||
"react-markdown": "^8.0.7",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if (args[2] === "--target") {
|
|||
}
|
||||
|
||||
(async () => {
|
||||
console.log("Packaging extension for target ", target);
|
||||
console.log("[info] Packaging extension for target ", target);
|
||||
|
||||
// Copy config_schema.json to config.json in docs
|
||||
fs.copyFileSync(
|
||||
|
|
@ -26,14 +26,16 @@ if (args[2] === "--target") {
|
|||
|
||||
// Install node_modules //
|
||||
execSync("npm install");
|
||||
console.log("npm install in extensions/vscode completed");
|
||||
console.log("[info] npm install in extensions/vscode completed");
|
||||
|
||||
process.chdir("../../gui");
|
||||
|
||||
execSync("npm install");
|
||||
console.log("npm install in gui completed");
|
||||
console.log("[info] npm install in gui completed");
|
||||
|
||||
execSync("npm run build");
|
||||
if (ghAction()) {
|
||||
execSync("npm run build");
|
||||
}
|
||||
|
||||
// Copy over the dist folder to the Intellij extension //
|
||||
const intellijExtensionWebviewPath = path.join(
|
||||
|
|
@ -54,8 +56,8 @@ if (args[2] === "--target") {
|
|||
await new Promise((resolve, reject) => {
|
||||
ncp("dist", intellijExtensionWebviewPath, (error) => {
|
||||
if (error) {
|
||||
console.log(
|
||||
"Error copying React app build to Intellij extension: ",
|
||||
console.warn(
|
||||
"[error] Error copying React app build to Intellij extension: ",
|
||||
error
|
||||
);
|
||||
reject(error);
|
||||
|
|
@ -69,7 +71,7 @@ if (args[2] === "--target") {
|
|||
}
|
||||
fs.copyFileSync("tmp_index.html", indexHtmlPath);
|
||||
fs.unlinkSync("tmp_index.html");
|
||||
console.log("Copied gui build to Intellij extension");
|
||||
console.log("[info] Copied gui build to Intellij extension");
|
||||
|
||||
// Then copy over the dist folder to the VSCode extension //
|
||||
const vscodeGuiPath = path.join("../extensions/vscode/gui");
|
||||
|
|
@ -91,9 +93,6 @@ if (args[2] === "--target") {
|
|||
|
||||
// Copy over native / wasm modules //
|
||||
process.chdir("../extensions/vscode");
|
||||
if (!ghAction() && fs.existsSync("./bin")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If target doesn't exist, but the bin folder also doesn't, we want to download it once, to help set up the dev environment
|
||||
if (!target) {
|
||||
|
|
@ -122,7 +121,7 @@ if (args[2] === "--target") {
|
|||
}[process.arch];
|
||||
|
||||
target = `${os}-${arch}`;
|
||||
console.log("Detected target: ", target);
|
||||
console.log("[info] Detected target: ", target);
|
||||
}
|
||||
fs.mkdirSync("bin", { recursive: true });
|
||||
|
||||
|
|
@ -133,7 +132,7 @@ if (args[2] === "--target") {
|
|||
path.join(__dirname, "../bin"),
|
||||
(error) => {
|
||||
if (error) {
|
||||
console.warn("Error copying onnxruntime-node files", error);
|
||||
console.warn("[info] Error copying onnxruntime-node files", error);
|
||||
reject(error);
|
||||
}
|
||||
resolve();
|
||||
|
|
@ -158,22 +157,60 @@ if (args[2] === "--target") {
|
|||
});
|
||||
}
|
||||
}
|
||||
console.log("Copied onnxruntime-node");
|
||||
console.log("[info] Copied onnxruntime-node");
|
||||
|
||||
// tree-sitter-wasms
|
||||
ncp(
|
||||
path.join(__dirname, "../../../core/node_modules/tree-sitter-wasms/out"),
|
||||
path.join(__dirname, "../out/tree-sitter-wasms"),
|
||||
(error) => {
|
||||
if (error) console.warn("Error copying tree-sitter-wasms files", error);
|
||||
}
|
||||
);
|
||||
// tree-sitter-wasm
|
||||
fs.mkdirSync("out", { recursive: true });
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
ncp(
|
||||
path.join(__dirname, "../../../core/node_modules/tree-sitter-wasms/out"),
|
||||
path.join(__dirname, "../out/tree-sitter-wasms"),
|
||||
(error) => {
|
||||
if (error) {
|
||||
console.warn("[error] Error copying tree-sitter-wasm files", error);
|
||||
reject(error);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, "../../../core/vendor/tree-sitter.wasm"),
|
||||
path.join(__dirname, "../out/tree-sitter.wasm")
|
||||
);
|
||||
console.log("Copied tree-sitter wasms");
|
||||
console.log("[info] Copied tree-sitter wasms");
|
||||
|
||||
// tree-sitter tag query files
|
||||
ncp(
|
||||
path.join(
|
||||
__dirname,
|
||||
"../../../core/node_modules/llm-code-highlighter/dist/tag-qry"
|
||||
),
|
||||
path.join(__dirname, "../out/tag-qry"),
|
||||
(error) => {
|
||||
if (error)
|
||||
console.warn("Error copying code-highlighter tag-qry files", error);
|
||||
}
|
||||
);
|
||||
|
||||
// textmate-syntaxes
|
||||
await new Promise((resolve, reject) => {
|
||||
ncp(
|
||||
path.join(__dirname, "../textmate-syntaxes"),
|
||||
path.join(__dirname, "../gui/textmate-syntaxes"),
|
||||
(error) => {
|
||||
if (error) {
|
||||
console.warn("[error] Error copying textmate-syntaxes", error);
|
||||
reject(error);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
function ghAction() {
|
||||
return target !== undefined;
|
||||
|
|
@ -196,17 +233,17 @@ if (args[2] === "--target") {
|
|||
// Neither lancedb nor sqlite3 have pre-built windows arm64 binaries
|
||||
if (!isWin()) {
|
||||
// lancedb binary
|
||||
console.log("Downloading pre-built lancedb binary");
|
||||
console.log("[info] Downloading pre-built lancedb binary");
|
||||
rimrafSync("node_modules/@lancedb");
|
||||
const packageToInstall = {
|
||||
"darwin-arm64": "@lancedb/vectordb-darwin-arm64",
|
||||
"linux-arm64": "@lancedb/vectordb-linux-arm64-gnu",
|
||||
}[target];
|
||||
execSync(`npm install -f ${packageToInstall}`);
|
||||
execSync(`npm install -f ${packageToInstall} --no-save`);
|
||||
}
|
||||
|
||||
// Download and unzip esbuild
|
||||
console.log("Downloading pre-built esbuild binary");
|
||||
console.log("[info] Downloading pre-built esbuild binary");
|
||||
rimrafSync("node_modules/@esbuild");
|
||||
fs.mkdirSync("node_modules/@esbuild", { recursive: true });
|
||||
execSync(
|
||||
|
|
@ -220,7 +257,7 @@ if (args[2] === "--target") {
|
|||
// sqlite3
|
||||
if (isArm() && !isWin()) {
|
||||
// Replace the installed with pre-built
|
||||
console.log("Downloading pre-built sqlite3 binary");
|
||||
console.log("[info] Downloading pre-built sqlite3 binary");
|
||||
rimrafSync("../../core/node_modules/sqlite3/build");
|
||||
const downloadUrl = {
|
||||
"darwin-arm64":
|
||||
|
|
@ -234,24 +271,45 @@ if (args[2] === "--target") {
|
|||
execSync("cd ../../core/node_modules/sqlite3 && tar -xvzf build.tar.gz");
|
||||
fs.unlinkSync("../../core/node_modules/sqlite3/build.tar.gz");
|
||||
}
|
||||
}
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
ncp(
|
||||
path.join(__dirname, "../../../core/node_modules/sqlite3/build"),
|
||||
path.join(__dirname, "../out/build"),
|
||||
(error) => {
|
||||
if (error) console.warn("Error copying sqlite3 files", error);
|
||||
if (error) {
|
||||
console.warn("[error] Error copying sqlite3 files", error);
|
||||
reject(error);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// Copy node_modules for pre-built binaries
|
||||
const NODE_MODULES_TO_COPY = ["esbuild", "@esbuild", "@lancedb"];
|
||||
fs.mkdirSync("out/node_modules", { recursive: true });
|
||||
NODE_MODULES_TO_COPY.forEach((mod) => {
|
||||
ncp.ncp(`node_modules/${mod}`, `out/node_modules/${mod}`, function (err) {
|
||||
if (err) {
|
||||
return console.error(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
await Promise.all(
|
||||
NODE_MODULES_TO_COPY.map(
|
||||
(mod) =>
|
||||
new Promise((resolve, reject) =>
|
||||
ncp(
|
||||
`node_modules/${mod}`,
|
||||
`out/node_modules/${mod}`,
|
||||
function (error) {
|
||||
if (error) {
|
||||
console.error(`[error] Error copying ${mod}`, error);
|
||||
reject(error);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
console.log(`[info] Copied ${NODE_MODULES_TO_COPY.join(", ")}`);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { getTsConfigPath } from "core/util/paths";
|
||||
import { getTsConfigPath, migrate } from "core/util/paths";
|
||||
import * as fs from "fs";
|
||||
import path from "path";
|
||||
import { v4 } from "uuid";
|
||||
|
|
@ -8,10 +8,13 @@ import IdeProtocolClient from "../continueIdeClient";
|
|||
import { ContinueGUIWebviewViewProvider } from "../debugPanel";
|
||||
import registerQuickFixProvider from "../lang-server/codeActions";
|
||||
import { registerAllCodeLensProviders } from "../lang-server/codeLens";
|
||||
import {
|
||||
ContinueCompletionProvider,
|
||||
setupStatusBar,
|
||||
} from "../lang-server/completionProvider";
|
||||
import { vsCodeIndexCodebase } from "../util/indexCodebase";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
import { setupInlineTips } from "./inlineTips";
|
||||
import { startProxy } from "./proxy";
|
||||
|
||||
export let extensionContext: vscode.ExtensionContext | undefined = undefined;
|
||||
export let ideProtocolClient: IdeProtocolClient;
|
||||
|
|
@ -85,6 +88,19 @@ export async function activateExtension(context: vscode.ExtensionContext) {
|
|||
await openTutorialFirstTime(context);
|
||||
setupInlineTips(context);
|
||||
showRefactorMigrationMessage();
|
||||
const config = vscode.workspace.getConfiguration("continue");
|
||||
const enabled = config.get<boolean>("enableTabAutocomplete");
|
||||
|
||||
// Register inline completion provider (odd versions are pre-release)
|
||||
if (parseInt(context.extension.packageJSON.version.split(".")[1]) % 2 !== 0) {
|
||||
setupStatusBar(enabled);
|
||||
context.subscriptions.push(
|
||||
vscode.languages.registerInlineCompletionItemProvider(
|
||||
[{ pattern: "**" }],
|
||||
new ContinueCompletionProvider()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
ideProtocolClient = new IdeProtocolClient(context);
|
||||
|
||||
|
|
@ -101,9 +117,17 @@ export async function activateExtension(context: vscode.ExtensionContext) {
|
|||
)
|
||||
);
|
||||
|
||||
startProxy();
|
||||
vsCodeIndexCodebase(ideProtocolClient.getWorkspaceDirectories());
|
||||
|
||||
migrate("showWelcome", () => {
|
||||
vscode.commands.executeCommand(
|
||||
"markdown.showPreview",
|
||||
vscode.Uri.file(
|
||||
path.join(getExtensionUri().fsPath, "media", "welcome.md")
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
// (async () => {
|
||||
// const defaultDocsPages = [
|
||||
// ["Socket.IO", "https://python-socketio.readthedocs.io/en/stable"],
|
||||
|
|
|
|||
|
|
@ -74,7 +74,10 @@ export function setupInlineTips(context: vscode.ExtensionContext) {
|
|||
context.subscriptions.push(
|
||||
vscode.window.onDidChangeActiveTextEditor((editor) => {
|
||||
if (editor?.document.getText() === "") {
|
||||
if (editor.document.uri.toString().startsWith("output:")) {
|
||||
if (
|
||||
editor.document.uri.toString().startsWith("output:") ||
|
||||
editor.document.uri.scheme === "comment"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
import * as vscode from "vscode";
|
||||
|
||||
function _getRawServerUrl() {
|
||||
// Passed in from launch.json
|
||||
if (process.env.CONTINUE_SERVER_URL) {
|
||||
return process.env.CONTINUE_SERVER_URL;
|
||||
}
|
||||
|
||||
return (
|
||||
vscode.workspace.getConfiguration("continue").get<string>("serverUrl") ||
|
||||
"http://localhost:65432"
|
||||
);
|
||||
}
|
||||
|
||||
export function getContinueServerUrl() {
|
||||
let url = _getRawServerUrl();
|
||||
if (url.endsWith("/")) {
|
||||
url = url.slice(0, -1);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ import * as os from "os";
|
|||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
import { ideProtocolClient } from "./activation/activate";
|
||||
import { extensionContext, ideProtocolClient } from "./activation/activate";
|
||||
import { debugPanelWebview, getSidebarContent } from "./debugPanel";
|
||||
import { acceptDiffCommand, rejectDiffCommand } from "./diff/horizontal";
|
||||
import {
|
||||
|
|
@ -11,6 +11,7 @@ import {
|
|||
streamEdit,
|
||||
verticalPerLineDiffManager,
|
||||
} from "./diff/verticalPerLine/manager";
|
||||
import { AutocompleteOutcome } from "./lang-server/completionProvider";
|
||||
|
||||
function addHighlightedCodeToContext(edit: boolean) {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
|
|
@ -122,11 +123,12 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
acceptRejectVerticalDiffBlock(false, filepath, index);
|
||||
},
|
||||
"continue.quickFix": async (message: string, code: string, edit: boolean) => {
|
||||
ideProtocolClient.sendMainUserInput(
|
||||
`${
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "newSessionWithPrompt",
|
||||
prompt: `${
|
||||
edit ? "/edit " : ""
|
||||
}${code}\n\nHow do I fix this problem in the above code?: ${message}`
|
||||
);
|
||||
}${code}\n\nHow do I fix this problem in the above code?: ${message}`,
|
||||
});
|
||||
if (!edit) {
|
||||
vscode.commands.executeCommand("continue.continueGUIView.focus");
|
||||
}
|
||||
|
|
@ -299,7 +301,13 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
"Continue",
|
||||
vscode.ViewColumn.One
|
||||
);
|
||||
panel.webview.html = getSidebarContent(panel, undefined, undefined, true);
|
||||
panel.webview.html = getSidebarContent(
|
||||
extensionContext,
|
||||
panel,
|
||||
undefined,
|
||||
undefined,
|
||||
true
|
||||
);
|
||||
},
|
||||
"continue.selectFilesAsContext": (
|
||||
firstUri: vscode.Uri,
|
||||
|
|
@ -322,6 +330,23 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
|
|||
`/references ${filepath.fsPath} ${position.line} ${position.character}`
|
||||
);
|
||||
},
|
||||
"continue.logAutocompleteOutcome": (
|
||||
outcome: AutocompleteOutcome,
|
||||
logRejectionTimeout: NodeJS.Timeout
|
||||
) => {
|
||||
clearTimeout(logRejectionTimeout);
|
||||
outcome.accepted = true;
|
||||
ideProtocolClient.logDevData("autocomplete", outcome);
|
||||
},
|
||||
"continue.toggleTabAutocompleteEnabled": () => {
|
||||
const config = vscode.workspace.getConfiguration("continue");
|
||||
const enabled = config.get("enableTabAutocomplete");
|
||||
config.update(
|
||||
"enableTabAutocomplete",
|
||||
!enabled,
|
||||
vscode.ConfigurationTarget.Global
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export function registerAllCommands(context: vscode.ExtensionContext) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { FileEdit, RangeInFile } from "core";
|
||||
import { getConfigJsonPath, getDevDataFilePath } from "core/util/paths";
|
||||
import { readFileSync, writeFileSync } from "fs";
|
||||
import { getDevDataFilePath } from "core/util/paths";
|
||||
import { writeFileSync } from "fs";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { extensionContext } from "./activation/activate";
|
||||
import { debugPanelWebview, getSidebarContent } from "./debugPanel";
|
||||
import { diffManager } from "./diff/horizontal";
|
||||
import { configHandler } from "./loadConfig";
|
||||
import { TabAutocompleteModel, configHandler } from "./loadConfig";
|
||||
import {
|
||||
SuggestionRanges,
|
||||
acceptSuggestionCommand,
|
||||
|
|
@ -29,11 +30,7 @@ class IdeProtocolClient {
|
|||
private static PREVIOUS_BRANCH_FOR_WORKSPACE_DIR: { [dir: string]: string } =
|
||||
{};
|
||||
|
||||
private readonly context: vscode.ExtensionContext;
|
||||
|
||||
constructor(context: vscode.ExtensionContext) {
|
||||
this.context = context;
|
||||
|
||||
// Listen for file saving
|
||||
vscode.workspace.onDidSaveTextDocument((event) => {
|
||||
const filepath = event.uri.fsPath;
|
||||
|
|
@ -45,10 +42,8 @@ class IdeProtocolClient {
|
|||
filepath.endsWith(".continue\\config.ts") ||
|
||||
filepath.endsWith(".continuerc.json")
|
||||
) {
|
||||
const config = readFileSync(getConfigJsonPath(), "utf8");
|
||||
const configJson = JSON.parse(config);
|
||||
this.configUpdate(configJson);
|
||||
configHandler.reloadConfig();
|
||||
TabAutocompleteModel.clearLlm();
|
||||
} else if (
|
||||
filepath.endsWith(".continueignore") ||
|
||||
filepath.endsWith(".gitignore")
|
||||
|
|
@ -106,13 +101,6 @@ class IdeProtocolClient {
|
|||
|
||||
visibleMessages: Set<string> = new Set();
|
||||
|
||||
configUpdate(config: any) {
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "configUpdate",
|
||||
config,
|
||||
});
|
||||
}
|
||||
|
||||
async gotoDefinition(
|
||||
filepath: string,
|
||||
position: vscode.Position
|
||||
|
|
@ -230,7 +218,12 @@ class IdeProtocolClient {
|
|||
"Continue",
|
||||
vscode.ViewColumn.One
|
||||
);
|
||||
panel.webview.html = getSidebarContent(panel, "/monaco", edits);
|
||||
panel.webview.html = getSidebarContent(
|
||||
extensionContext,
|
||||
panel,
|
||||
"/monaco",
|
||||
edits
|
||||
);
|
||||
}
|
||||
|
||||
openFile(filepath: string, range?: vscode.Range) {
|
||||
|
|
@ -366,7 +359,7 @@ class IdeProtocolClient {
|
|||
gitRoot || directory,
|
||||
[],
|
||||
true,
|
||||
onlyThisDirectory
|
||||
gitRoot === directory ? undefined : onlyThisDirectory
|
||||
)) {
|
||||
allFiles.push(file);
|
||||
}
|
||||
|
|
@ -410,6 +403,21 @@ class IdeProtocolClient {
|
|||
return contents;
|
||||
}
|
||||
|
||||
async readRangeInFile(
|
||||
filepath: string,
|
||||
range: vscode.Range
|
||||
): Promise<string> {
|
||||
const contents = new TextDecoder().decode(
|
||||
await vscode.workspace.fs.readFile(vscode.Uri.file(filepath))
|
||||
);
|
||||
const lines = contents.split("\n");
|
||||
return (
|
||||
lines.slice(range.start.line, range.end.line).join("\n") +
|
||||
"\n" +
|
||||
lines[range.end.line].slice(0, range.end.character)
|
||||
);
|
||||
}
|
||||
|
||||
async getTerminalContents(commands: number = -1): Promise<string> {
|
||||
const tempCopyBuffer = await vscode.env.clipboard.readText();
|
||||
if (commands < 0) {
|
||||
|
|
|
|||
|
|
@ -2,26 +2,22 @@ import { ContextItemId, DiffLine, FileEdit, ModelDescription } from "core";
|
|||
import { indexDocs } from "core/indexing/docs";
|
||||
import TransformersJsEmbeddingsProvider from "core/indexing/embeddings/TransformersJsEmbeddingsProvider";
|
||||
import { editConfigJson, getConfigJsonPath } from "core/util/paths";
|
||||
import * as fs from "fs";
|
||||
import { readFileSync, writeFileSync } from "fs";
|
||||
import * as path from "path";
|
||||
import * as io from "socket.io-client";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
import {
|
||||
extensionContext,
|
||||
ideProtocolClient,
|
||||
showTutorial,
|
||||
windowId,
|
||||
} from "./activation/activate";
|
||||
import { getContinueServerUrl } from "./bridge";
|
||||
import { streamEdit } from "./diff/verticalPerLine/manager";
|
||||
import historyManager from "./history";
|
||||
import { VsCodeIde } from "./ideProtocol";
|
||||
import { configHandler, llmFromTitle } from "./loadConfig";
|
||||
import { getTheme } from "./util/getTheme";
|
||||
import { getExtensionUri, getNonce, getUniqueId } from "./util/vscode";
|
||||
|
||||
let sockets: { [url: string]: io.Socket | undefined } = {};
|
||||
|
||||
export let debugPanelWebview: vscode.Webview | undefined;
|
||||
|
||||
export async function webviewRequest(
|
||||
|
|
@ -49,7 +45,10 @@ export async function webviewRequest(
|
|||
});
|
||||
}
|
||||
|
||||
const abortedMessageIds: Set<string> = new Set();
|
||||
|
||||
export function getSidebarContent(
|
||||
context: vscode.ExtensionContext | undefined,
|
||||
panel: vscode.WebviewPanel | vscode.WebviewView,
|
||||
page: string | undefined = undefined,
|
||||
edits: FileEdit[] | undefined = undefined,
|
||||
|
|
@ -69,8 +68,9 @@ export function getSidebarContent(
|
|||
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "gui"))
|
||||
.toString();
|
||||
|
||||
const isProduction = true; // context?.extensionMode === vscode.ExtensionMode.Development;
|
||||
if (isProduction) {
|
||||
const inDevelopmentMode =
|
||||
context?.extensionMode === vscode.ExtensionMode.Development;
|
||||
if (!inDevelopmentMode) {
|
||||
scriptUri = panel.webview
|
||||
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "gui/assets/index.js"))
|
||||
.toString();
|
||||
|
|
@ -79,12 +79,15 @@ export function getSidebarContent(
|
|||
.toString();
|
||||
} else {
|
||||
scriptUri = "http://localhost:5173/src/main.tsx";
|
||||
styleMainUri = "http://localhost:5173/src/main.css";
|
||||
styleMainUri = "http://localhost:5173/src/index.css";
|
||||
}
|
||||
|
||||
panel.webview.options = {
|
||||
enableScripts: true,
|
||||
localResourceRoots: [vscode.Uri.joinPath(extensionUri, "gui")],
|
||||
localResourceRoots: [
|
||||
vscode.Uri.joinPath(extensionUri, "gui"),
|
||||
vscode.Uri.joinPath(extensionUri, "assets"),
|
||||
],
|
||||
enableCommandUris: true,
|
||||
portMapping: [
|
||||
{
|
||||
|
|
@ -96,53 +99,6 @@ export function getSidebarContent(
|
|||
|
||||
const nonce = getNonce();
|
||||
|
||||
async function connectWebsocket(url: string) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const onMessage = (message: any) => {
|
||||
panel.webview.postMessage({
|
||||
type: "websocketForwardingMessage",
|
||||
url,
|
||||
data: message,
|
||||
});
|
||||
};
|
||||
const onOpen = () => {
|
||||
panel.webview.postMessage({
|
||||
type: "websocketForwardingOpen",
|
||||
url,
|
||||
});
|
||||
resolve(null);
|
||||
};
|
||||
const onClose = () => {
|
||||
sockets[url] = undefined;
|
||||
panel.webview.postMessage({
|
||||
type: "websocketForwardingClose",
|
||||
url,
|
||||
});
|
||||
};
|
||||
const onError = (e: any) => {
|
||||
panel.webview.postMessage({
|
||||
type: "websocketForwardingError",
|
||||
url,
|
||||
error: e,
|
||||
});
|
||||
};
|
||||
try {
|
||||
const socket = io.io(
|
||||
`${getContinueServerUrl()}?window_id=${windowId}`,
|
||||
{
|
||||
path: "/gui/socket.io",
|
||||
transports: ["websocket", "polling", "flashsocket"],
|
||||
}
|
||||
);
|
||||
sockets[url] = socket;
|
||||
resolve(null);
|
||||
} catch (e) {
|
||||
console.log("Failed to connect to GUI websocket for forwarding", e);
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
panel.webview.onDidReceiveMessage(async (data) => {
|
||||
const ide = new VsCodeIde();
|
||||
const respond = (message: any) => {
|
||||
|
|
@ -154,42 +110,8 @@ export function getSidebarContent(
|
|||
};
|
||||
try {
|
||||
switch (data.type) {
|
||||
case "websocketForwardingOpen": {
|
||||
let url = data.url;
|
||||
if (typeof sockets[url] === "undefined") {
|
||||
await connectWebsocket(url);
|
||||
} else {
|
||||
console.log(
|
||||
"Websocket connection requested by GUI already open at",
|
||||
url
|
||||
);
|
||||
panel.webview.postMessage({
|
||||
type: "websocketForwardingOpen",
|
||||
url,
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "websocketForwardingClose": {
|
||||
let url = data.url;
|
||||
let socket = sockets[url];
|
||||
if (typeof socket !== "undefined") {
|
||||
socket.close();
|
||||
sockets[url] = undefined;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "websocketForwardingMessage": {
|
||||
let url = data.url;
|
||||
let socket = sockets[url];
|
||||
if (typeof socket === "undefined") {
|
||||
await connectWebsocket(url);
|
||||
}
|
||||
socket = sockets[url];
|
||||
if (typeof socket === "undefined") {
|
||||
throw new Error("Failed to connect socket for forwarding");
|
||||
}
|
||||
socket.send(data.message);
|
||||
case "abort": {
|
||||
abortedMessageIds.add(data.messageId);
|
||||
break;
|
||||
}
|
||||
case "showFile": {
|
||||
|
|
@ -277,10 +199,6 @@ export function getSidebarContent(
|
|||
respond(await ide.getSerializedConfig());
|
||||
break;
|
||||
}
|
||||
case "getConfigJsUrl": {
|
||||
respond(await ide.getConfigJsUrl());
|
||||
break;
|
||||
}
|
||||
case "getTerminalContents": {
|
||||
respond(await ide.getTerminalContents());
|
||||
break;
|
||||
|
|
@ -461,8 +379,7 @@ export function getSidebarContent(
|
|||
2
|
||||
);
|
||||
writeFileSync(getConfigJsonPath(), newConfigString);
|
||||
ideProtocolClient.configUpdate(configJson);
|
||||
|
||||
configHandler.reloadConfig();
|
||||
ideProtocolClient.openFile(getConfigJsonPath());
|
||||
|
||||
// Find the range where it was added and highlight
|
||||
|
|
@ -508,7 +425,7 @@ export function getSidebarContent(
|
|||
);
|
||||
return config;
|
||||
});
|
||||
ideProtocolClient.configUpdate(configJson);
|
||||
configHandler.reloadConfig();
|
||||
break;
|
||||
}
|
||||
case "addOpenAIKey": {
|
||||
|
|
@ -522,7 +439,7 @@ export function getSidebarContent(
|
|||
});
|
||||
return config;
|
||||
});
|
||||
ideProtocolClient.configUpdate(configJson);
|
||||
configHandler.reloadConfig();
|
||||
break;
|
||||
}
|
||||
case "llmStreamComplete": {
|
||||
|
|
@ -533,6 +450,11 @@ export function getSidebarContent(
|
|||
);
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
if (abortedMessageIds.has(data.messageId)) {
|
||||
abortedMessageIds.delete(data.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
break;
|
||||
}
|
||||
respond({ content: next.value });
|
||||
next = await gen.next();
|
||||
}
|
||||
|
|
@ -548,6 +470,11 @@ export function getSidebarContent(
|
|||
);
|
||||
let next = await gen.next();
|
||||
while (!next.done) {
|
||||
if (abortedMessageIds.has(data.messageId)) {
|
||||
abortedMessageIds.delete(data.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
break;
|
||||
}
|
||||
respond({ content: next.value.content });
|
||||
next = await gen.next();
|
||||
}
|
||||
|
|
@ -572,9 +499,10 @@ export function getSidebarContent(
|
|||
slashCommandName,
|
||||
contextItems,
|
||||
params,
|
||||
historyIndex,
|
||||
} = data.message;
|
||||
|
||||
const config = await configHandler.loadConfig(ide);
|
||||
const config = await configHandler.loadConfig();
|
||||
const llm = await llmFromTitle(modelTitle);
|
||||
const slashCommand = config.slashCommands?.find(
|
||||
(sc) => sc.name === slashCommandName
|
||||
|
|
@ -590,16 +518,23 @@ export function getSidebarContent(
|
|||
contextItems,
|
||||
params,
|
||||
ide,
|
||||
addContextItem: () => {},
|
||||
addContextItem: (item) => {
|
||||
debugPanelWebview?.postMessage({
|
||||
type: "addContextItem",
|
||||
message: { item, historyIndex },
|
||||
});
|
||||
},
|
||||
})) {
|
||||
respond({ content: update });
|
||||
if (update) {
|
||||
respond({ content: update });
|
||||
}
|
||||
}
|
||||
respond({ done: true });
|
||||
break;
|
||||
}
|
||||
case "loadSubmenuItems": {
|
||||
const { title } = data.message;
|
||||
const config = await configHandler.loadConfig(ide);
|
||||
const config = await configHandler.loadConfig();
|
||||
const provider = config.contextProviders?.find(
|
||||
(p) => p.description.title === title
|
||||
);
|
||||
|
|
@ -626,7 +561,7 @@ export function getSidebarContent(
|
|||
}
|
||||
case "getContextItems": {
|
||||
const { name, query, fullInput, selectedCode } = data.message;
|
||||
const config = await configHandler.loadConfig(ide);
|
||||
const config = await configHandler.loadConfig();
|
||||
const llm = await llmFromTitle();
|
||||
const provider = config.contextProviders?.find(
|
||||
(p) => p.description.title === name
|
||||
|
|
@ -748,41 +683,13 @@ export function getSidebarContent(
|
|||
}
|
||||
});
|
||||
|
||||
let currentTheme = undefined;
|
||||
let colorThemeName = "dark-plus";
|
||||
const tokenColorMap: any = {};
|
||||
try {
|
||||
// Pass color theme to webview for syntax highlighting
|
||||
const colorTheme = vscode.workspace
|
||||
.getConfiguration("workbench")
|
||||
.get("colorTheme");
|
||||
|
||||
for (let i = vscode.extensions.all.length - 1; i >= 0; i--) {
|
||||
if (currentTheme) {
|
||||
break;
|
||||
}
|
||||
const extension = vscode.extensions.all[i];
|
||||
if (extension.packageJSON?.contributes?.themes?.length > 0) {
|
||||
for (const theme of extension.packageJSON.contributes.themes) {
|
||||
if (theme.label === colorTheme) {
|
||||
const themePath = path.join(extension.extensionPath, theme.path);
|
||||
currentTheme = fs.readFileSync(themePath).toString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
const currentTheme = getTheme();
|
||||
vscode.workspace.onDidChangeConfiguration((e) => {
|
||||
if (e.affectsConfiguration("workbench.colorTheme")) {
|
||||
// Send new theme to GUI to update embedded Monaco themes
|
||||
debugPanelWebview?.postMessage({ type: "setTheme", theme: getTheme() });
|
||||
}
|
||||
|
||||
// Strip comments from theme
|
||||
currentTheme = currentTheme
|
||||
?.split("\n")
|
||||
.filter((line) => {
|
||||
return !line.trim().startsWith("//");
|
||||
})
|
||||
.join("\n");
|
||||
} catch (e) {
|
||||
console.log("Error adding .continueignore file icon: ", e);
|
||||
}
|
||||
});
|
||||
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
@ -796,25 +703,34 @@ export function getSidebarContent(
|
|||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
${
|
||||
inDevelopmentMode
|
||||
? `<script type="module">
|
||||
import RefreshRuntime from "http://localhost:5173/@react-refresh"
|
||||
RefreshRuntime.injectIntoGlobalHook(window)
|
||||
window.$RefreshReg$ = () => {}
|
||||
window.$RefreshSig$ = () => (type) => type
|
||||
window.__vite_plugin_react_preamble_installed__ = true
|
||||
</script>`
|
||||
: ""
|
||||
}
|
||||
|
||||
<script type="module" nonce="${nonce}" src="${scriptUri}"></script>
|
||||
|
||||
<script>localStorage.setItem("ide", "vscode")</script>
|
||||
<script>window.windowId = "${windowId}"</script>
|
||||
<script>window.serverUrl = "${getContinueServerUrl()}"</script>
|
||||
<script>window.vscMachineId = "${getUniqueId()}"</script>
|
||||
<script>window.vscMediaUrl = "${vscMediaUrl}"</script>
|
||||
<script>window.ide = "vscode"</script>
|
||||
<script>window.fullColorTheme = ${currentTheme}</script>
|
||||
<script>window.colorThemeName = "${colorThemeName}"</script>
|
||||
<script>window.fullColorTheme = ${JSON.stringify(currentTheme)}</script>
|
||||
<script>window.colorThemeName = "dark-plus"</script>
|
||||
<script>window.workspacePaths = ${JSON.stringify(
|
||||
vscode.workspace.workspaceFolders?.map(
|
||||
(folder) => folder.uri.fsPath
|
||||
) || []
|
||||
)}</script>
|
||||
<script>window.isFullScreen = ${isFullScreen}</script>
|
||||
<script>window.proxyServerUrl = "${vscode.workspace
|
||||
.getConfiguration("continue")
|
||||
.get("proxyServerUrl")}"</script>
|
||||
|
||||
${
|
||||
edits
|
||||
|
|
@ -836,6 +752,6 @@ export class ContinueGUIWebviewViewProvider
|
|||
_context: vscode.WebviewViewResolveContext,
|
||||
_token: vscode.CancellationToken
|
||||
): void | Thenable<void> {
|
||||
webviewView.webview.html = getSidebarContent(webviewView);
|
||||
webviewView.webview.html = getSidebarContent(extensionContext, webviewView);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,241 +1,26 @@
|
|||
import { exec } from "child_process";
|
||||
import defaultConfig from "core/config/default";
|
||||
import {
|
||||
getConfigJsPath,
|
||||
getConfigJsonPath,
|
||||
getConfigTsPath,
|
||||
getContinueGlobalPath,
|
||||
migrate,
|
||||
} from "core/util/paths";
|
||||
import * as fs from "fs";
|
||||
import { getContinueGlobalPath } from "core/util/paths";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { ideProtocolClient } from "./activation/activate";
|
||||
|
||||
import * as child_process from "child_process";
|
||||
import { Chunk, DiffLine, IDE, Problem } from "core";
|
||||
import {
|
||||
Chunk,
|
||||
ContinueConfig,
|
||||
DiffLine,
|
||||
IDE,
|
||||
Problem,
|
||||
SerializedContinueConfig,
|
||||
} from "core";
|
||||
import {
|
||||
intermediateToFinalConfig,
|
||||
serializedToIntermediateConfig,
|
||||
BrowserSerializedContinueConfig,
|
||||
finalToBrowserConfig,
|
||||
} from "core/config/load";
|
||||
import { LanceDbIndex } from "core/indexing/LanceDbIndex";
|
||||
import { IndexTag } from "core/indexing/types";
|
||||
import mergeJson from "core/util/merge";
|
||||
import { verticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import { configHandler } from "./loadConfig";
|
||||
import { traverseDirectory } from "./util/traverseDirectory";
|
||||
import { getExtensionUri, openEditorAndRevealRange } from "./util/vscode";
|
||||
|
||||
async function buildConfigTs(browser: boolean) {
|
||||
if (!fs.existsSync(getConfigTsPath())) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
// Dynamic import esbuild so potentially disastrous errors can be caught
|
||||
const esbuild = require("esbuild");
|
||||
|
||||
await esbuild.build({
|
||||
entryPoints: [getConfigTsPath()],
|
||||
bundle: true,
|
||||
platform: browser ? "browser" : "node",
|
||||
format: browser ? "esm" : "cjs",
|
||||
outfile: getConfigJsPath(!browser),
|
||||
external: ["fetch", "fs", "path", "os", "child_process"],
|
||||
sourcemap: true,
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
vscode.window.showErrorMessage(
|
||||
"Build error. Please check your ~/.continue/config.ts file: " + e
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(getConfigJsPath(!browser))) {
|
||||
return undefined;
|
||||
}
|
||||
return fs.readFileSync(getConfigJsPath(!browser), "utf8");
|
||||
}
|
||||
|
||||
class VsCodeIde implements IDE {
|
||||
async getSerializedConfig(): Promise<SerializedContinueConfig> {
|
||||
try {
|
||||
const configPath = getConfigJsonPath();
|
||||
let contents = fs.readFileSync(configPath, "utf8");
|
||||
let config = JSON.parse(contents) as SerializedContinueConfig;
|
||||
if (config.allowAnonymousTelemetry === undefined) {
|
||||
config.allowAnonymousTelemetry = true;
|
||||
}
|
||||
config.allowAnonymousTelemetry =
|
||||
config.allowAnonymousTelemetry &&
|
||||
vscode.workspace.getConfiguration("continue").get("telemetryEnabled");
|
||||
|
||||
// Migrate to camelCase - replace all instances of "snake_case" with "camelCase"
|
||||
migrate("camelCaseConfig", () => {
|
||||
contents = contents
|
||||
.replace(/(_\w)/g, function (m) {
|
||||
return m[1].toUpperCase();
|
||||
})
|
||||
.replace("openai-aiohttp", "openai");
|
||||
|
||||
fs.writeFileSync(configPath, contents, "utf8");
|
||||
});
|
||||
|
||||
migrate("codebaseContextProvider", () => {
|
||||
if (
|
||||
!config.contextProviders?.filter((cp) => cp.name === "codebase")
|
||||
?.length
|
||||
) {
|
||||
config.contextProviders = [
|
||||
...(config.contextProviders || []),
|
||||
{
|
||||
name: "codebase",
|
||||
params: {},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
if (!config.embeddingsProvider) {
|
||||
config.embeddingsProvider = {
|
||||
provider: "transformers.js",
|
||||
};
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
configPath,
|
||||
JSON.stringify(config, undefined, 2),
|
||||
"utf8"
|
||||
);
|
||||
});
|
||||
|
||||
migrate("problemsContextProvider", () => {
|
||||
if (
|
||||
!config.contextProviders?.filter((cp) => cp.name === "problems")
|
||||
?.length
|
||||
) {
|
||||
config.contextProviders = [
|
||||
...(config.contextProviders || []),
|
||||
{
|
||||
name: "problems",
|
||||
params: {},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
configPath,
|
||||
JSON.stringify(config, undefined, 2),
|
||||
"utf8"
|
||||
);
|
||||
});
|
||||
|
||||
migrate("foldersContextProvider", () => {
|
||||
if (
|
||||
!config.contextProviders?.filter((cp) => cp.name === "folder")?.length
|
||||
) {
|
||||
config.contextProviders = [
|
||||
...(config.contextProviders || []),
|
||||
{
|
||||
name: "folder",
|
||||
params: {},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
configPath,
|
||||
JSON.stringify(config, undefined, 2),
|
||||
"utf8"
|
||||
);
|
||||
});
|
||||
|
||||
migrate("renameFreeTrialProvider", () => {
|
||||
contents = contents.replace(/openai-free-trial/g, "free-trial");
|
||||
fs.writeFileSync(configPath, contents, "utf8");
|
||||
});
|
||||
|
||||
for (const workspacePath of await this.getWorkspaceDirs()) {
|
||||
const continueRcPath = path.join(workspacePath, ".continuerc.json");
|
||||
if (fs.existsSync(continueRcPath)) {
|
||||
const continueRc = JSON.parse(
|
||||
fs.readFileSync(continueRcPath, "utf8")
|
||||
) as Partial<SerializedContinueConfig>;
|
||||
config = mergeJson(config, continueRc);
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
} catch (e) {
|
||||
vscode.window
|
||||
.showErrorMessage(
|
||||
"Error loading config.json. Please check your config.json file: " + e,
|
||||
"Open config.json"
|
||||
)
|
||||
.then((selection) => {
|
||||
if (selection === "Open config.json") {
|
||||
vscode.workspace
|
||||
.openTextDocument(getConfigJsonPath())
|
||||
.then((doc) => {
|
||||
vscode.window.showTextDocument(doc);
|
||||
});
|
||||
}
|
||||
});
|
||||
return defaultConfig;
|
||||
}
|
||||
}
|
||||
|
||||
async getConfigJsUrl(): Promise<string | undefined> {
|
||||
const configJsString = await buildConfigTs(true);
|
||||
|
||||
if (!configJsString) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
var dataUrl = "data:text/javascript;base64," + btoa(configJsString);
|
||||
return dataUrl;
|
||||
|
||||
// try {
|
||||
// // Use tsc to compile config.ts to config.js. Spawn a child process to do this
|
||||
// // But we've packaged a file tsc.js in this folder, so just call that
|
||||
// const { spawn } = require("child_process");
|
||||
// const child = spawn(process.execPath, [
|
||||
// __dirname + "/tsc.js",
|
||||
// "--project",
|
||||
// getTsConfigPath(),
|
||||
// ]);
|
||||
|
||||
// await new Promise((resolve, reject) => {
|
||||
// child.stdout.on("data", (data: any) => {
|
||||
// console.log(`stdout: ${data}`);
|
||||
// });
|
||||
// child.stderr.on("data", (data: any) => {
|
||||
// reject(data);
|
||||
// });
|
||||
// child.on("close", (code: any) => {
|
||||
// console.log(`child process exited with code ${code}`);
|
||||
// resolve(null);
|
||||
// });
|
||||
// });
|
||||
|
||||
// const configJsString = fs.readFileSync(getConfigJsPath(), "utf8");
|
||||
// var dataUrl = "data:text/javascript;base64," + btoa(configJsString);
|
||||
|
||||
// return dataUrl;
|
||||
// } catch (e) {
|
||||
// console.log(e);
|
||||
// vscode.window.showErrorMessage(
|
||||
// "Error loading config.js. Please check your config.ts file: " + e
|
||||
// );
|
||||
// return undefined;
|
||||
// }
|
||||
async getSerializedConfig(): Promise<BrowserSerializedContinueConfig> {
|
||||
const config = await configHandler.loadConfig();
|
||||
return finalToBrowserConfig(config);
|
||||
}
|
||||
|
||||
async getDiff(): Promise<string> {
|
||||
|
|
@ -264,7 +49,12 @@ class VsCodeIde implements IDE {
|
|||
|
||||
const workspaceDirs = await this.getWorkspaceDirs();
|
||||
for (const directory of workspaceDirs) {
|
||||
for await (const dir of traverseDirectory(directory, [], false)) {
|
||||
for await (const dir of traverseDirectory(
|
||||
directory,
|
||||
[],
|
||||
false,
|
||||
undefined
|
||||
)) {
|
||||
allDirs.push(dir);
|
||||
}
|
||||
}
|
||||
|
|
@ -457,7 +247,7 @@ class VsCodeIde implements IDE {
|
|||
n: number,
|
||||
directory: string | undefined
|
||||
): Promise<Chunk[]> {
|
||||
const embeddingsProvider = (await configHandler.loadConfig(new VsCodeIde()))
|
||||
const embeddingsProvider = (await configHandler.loadConfig())
|
||||
.embeddingsProvider;
|
||||
if (!embeddingsProvider) {
|
||||
return [];
|
||||
|
|
@ -482,32 +272,4 @@ class VsCodeIde implements IDE {
|
|||
}
|
||||
}
|
||||
|
||||
async function loadFullConfigNode(ide: IDE): Promise<ContinueConfig> {
|
||||
let serialized = await ide.getSerializedConfig();
|
||||
let intermediate = serializedToIntermediateConfig(serialized);
|
||||
|
||||
const configJsContents = await buildConfigTs(false);
|
||||
if (configJsContents) {
|
||||
try {
|
||||
// Try config.ts first
|
||||
const configJsPath = getConfigJsPath(true);
|
||||
const module = await require(configJsPath);
|
||||
delete require.cache[require.resolve(configJsPath)];
|
||||
if (!module.modifyConfig) {
|
||||
throw new Error("config.ts does not export a modifyConfig function.");
|
||||
}
|
||||
intermediate = module.modifyConfig(intermediate);
|
||||
} catch (e) {
|
||||
console.log("Error loading config.ts: ", e);
|
||||
}
|
||||
}
|
||||
const finalConfig = await intermediateToFinalConfig(
|
||||
intermediate,
|
||||
async (filepath) => {
|
||||
return ideProtocolClient.readFile(filepath);
|
||||
}
|
||||
);
|
||||
return finalConfig;
|
||||
}
|
||||
|
||||
export { VsCodeIde, buildConfigTs, loadFullConfigNode };
|
||||
export { VsCodeIde };
|
||||
|
|
|
|||
474
extensions/vscode/src/lang-server/completionProvider.ts
Normal file
474
extensions/vscode/src/lang-server/completionProvider.ts
Normal file
|
|
@ -0,0 +1,474 @@
|
|||
import { TabAutocompleteOptions } from "core";
|
||||
import { AutocompleteLruCache } from "core/autocomplete/cache";
|
||||
import { onlyWhitespaceAfterEndOfLine } from "core/autocomplete/charStream";
|
||||
import {
|
||||
AutocompleteSnippet,
|
||||
constructAutocompletePrompt,
|
||||
languageForFilepath,
|
||||
} from "core/autocomplete/constructPrompt";
|
||||
import {
|
||||
stopAtSimilarLine,
|
||||
streamWithNewLines,
|
||||
} from "core/autocomplete/lineStream";
|
||||
import { DEFAULT_AUTOCOMPLETE_OPTS } from "core/autocomplete/parameters";
|
||||
import { getTemplateForModel } from "core/autocomplete/templates";
|
||||
import { streamLines } from "core/diff/util";
|
||||
import Handlebars from "handlebars";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
import { ideProtocolClient } from "../activation/activate";
|
||||
import { TabAutocompleteModel, configHandler } from "../loadConfig";
|
||||
|
||||
const statusBarItemText = (enabled: boolean | undefined) =>
|
||||
enabled ? "$(check) Continue" : "$(circle-slash) Continue";
|
||||
|
||||
const statusBarItemTooltip = (enabled: boolean | undefined) =>
|
||||
enabled ? "Tab autocomplete is enabled" : "Click to enable tab autocomplete";
|
||||
|
||||
let lastStatusBar: vscode.StatusBarItem | undefined = undefined;
|
||||
let statusBarFalseTimeout: NodeJS.Timeout | undefined = undefined;
|
||||
|
||||
function stopStatusBarLoading() {
|
||||
statusBarFalseTimeout = setTimeout(() => {
|
||||
setupStatusBar(true, false);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
export function setupStatusBar(
|
||||
enabled: boolean | undefined,
|
||||
loading?: boolean
|
||||
) {
|
||||
if (loading !== false) {
|
||||
clearTimeout(statusBarFalseTimeout);
|
||||
statusBarFalseTimeout = undefined;
|
||||
}
|
||||
|
||||
const statusBarItem = vscode.window.createStatusBarItem(
|
||||
vscode.StatusBarAlignment.Right
|
||||
);
|
||||
statusBarItem.text = loading
|
||||
? "$(loading~spin) Continue"
|
||||
: statusBarItemText(enabled);
|
||||
statusBarItem.tooltip = statusBarItemTooltip(enabled);
|
||||
statusBarItem.command = "continue.toggleTabAutocompleteEnabled";
|
||||
|
||||
// Swap out with old status bar
|
||||
if (lastStatusBar) {
|
||||
lastStatusBar.dispose();
|
||||
}
|
||||
statusBarItem.show();
|
||||
lastStatusBar = statusBarItem;
|
||||
|
||||
vscode.workspace.onDidChangeConfiguration((event) => {
|
||||
if (event.affectsConfiguration("continue")) {
|
||||
const config = vscode.workspace.getConfiguration("continue");
|
||||
const enabled = config.get<boolean>("enableTabAutocomplete");
|
||||
statusBarItem.dispose();
|
||||
setupStatusBar(enabled);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function getDefinition(
|
||||
uri: string,
|
||||
line: number,
|
||||
character: number
|
||||
): Promise<AutocompleteSnippet | undefined> {
|
||||
const definitions = (await vscode.commands.executeCommand(
|
||||
"vscode.executeDefinitionProvider",
|
||||
vscode.Uri.parse(uri),
|
||||
new vscode.Position(line, character)
|
||||
)) as any;
|
||||
|
||||
if (definitions[0]?.targetRange) {
|
||||
return {
|
||||
filepath: uri,
|
||||
content: await ideProtocolClient.readRangeInFile(
|
||||
definitions[0].targetUri.fsPath,
|
||||
definitions[0].targetRange
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export interface AutocompleteOutcome {
|
||||
accepted?: boolean;
|
||||
time: number;
|
||||
prompt: string;
|
||||
completion: string;
|
||||
modelProvider: string;
|
||||
modelName: string;
|
||||
completionOptions: any;
|
||||
cacheHit: boolean;
|
||||
}
|
||||
|
||||
const autocompleteCache = AutocompleteLruCache.get();
|
||||
|
||||
class ListenableGenerator<T> {
|
||||
private _source: AsyncGenerator<T>;
|
||||
private _buffer: T[] = [];
|
||||
private _listeners: Set<(value: T) => void> = new Set();
|
||||
private _isEnded: boolean = false;
|
||||
|
||||
constructor(source: AsyncGenerator<T>) {
|
||||
this._source = source;
|
||||
this._start();
|
||||
}
|
||||
|
||||
public cancel() {
|
||||
this._isEnded = true;
|
||||
}
|
||||
|
||||
private async _start() {
|
||||
try {
|
||||
for await (const value of this._source) {
|
||||
if (this._isEnded) {
|
||||
break;
|
||||
}
|
||||
this._buffer.push(value);
|
||||
for (const listener of this._listeners) {
|
||||
listener(value);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
this._isEnded = true;
|
||||
for (const listener of this._listeners) {
|
||||
listener(null as any);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
listen(listener: (value: T) => void) {
|
||||
this._listeners.add(listener);
|
||||
for (const value of this._buffer) {
|
||||
listener(value);
|
||||
}
|
||||
if (this._isEnded) {
|
||||
listener(null as any);
|
||||
}
|
||||
}
|
||||
|
||||
async *tee(): AsyncGenerator<T> {
|
||||
try {
|
||||
for (const value of this._buffer) {
|
||||
yield value;
|
||||
}
|
||||
while (!this._isEnded) {
|
||||
let resolve: (value: any) => void;
|
||||
let promise = new Promise<T>((res) => {
|
||||
resolve = res;
|
||||
this._listeners.add(resolve!);
|
||||
});
|
||||
const value = await promise;
|
||||
this._listeners.delete(resolve!);
|
||||
|
||||
yield value;
|
||||
}
|
||||
} finally {
|
||||
// this._listeners.delete(resolve!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GeneratorReuseManager {
|
||||
static currentGenerator: ListenableGenerator<string> | undefined;
|
||||
static pendingGeneratorPrefix: string | undefined;
|
||||
static pendingCompletion: string = "";
|
||||
|
||||
private static _createListenableGenerator(
|
||||
gen: AsyncGenerator<string>,
|
||||
prefix: string
|
||||
) {
|
||||
GeneratorReuseManager.currentGenerator?.cancel();
|
||||
|
||||
const listenableGen = new ListenableGenerator(gen);
|
||||
listenableGen.listen(
|
||||
(chunk) => (GeneratorReuseManager.pendingCompletion += chunk ?? "")
|
||||
);
|
||||
|
||||
GeneratorReuseManager.pendingGeneratorPrefix = prefix;
|
||||
GeneratorReuseManager.pendingCompletion = "";
|
||||
GeneratorReuseManager.currentGenerator = listenableGen;
|
||||
}
|
||||
|
||||
static async *getGenerator(
|
||||
prefix: string,
|
||||
newGenerator: () => AsyncGenerator<string>
|
||||
): AsyncGenerator<string> {
|
||||
// Check if current can be reused
|
||||
if (
|
||||
!(
|
||||
GeneratorReuseManager.currentGenerator &&
|
||||
GeneratorReuseManager.pendingGeneratorPrefix &&
|
||||
(
|
||||
GeneratorReuseManager.pendingGeneratorPrefix +
|
||||
GeneratorReuseManager.pendingCompletion
|
||||
).startsWith(prefix) &&
|
||||
// for e.g. backspace
|
||||
GeneratorReuseManager.pendingGeneratorPrefix?.length <= prefix?.length
|
||||
)
|
||||
) {
|
||||
// Create a wrapper over the current generator to fix the prompt
|
||||
GeneratorReuseManager._createListenableGenerator(newGenerator(), prefix);
|
||||
}
|
||||
|
||||
let alreadyTyped =
|
||||
prefix.slice(GeneratorReuseManager.pendingGeneratorPrefix?.length) || "";
|
||||
for await (let chunk of GeneratorReuseManager.currentGenerator!.tee()) {
|
||||
if (!chunk) {
|
||||
continue;
|
||||
}
|
||||
while (chunk.length && alreadyTyped.length) {
|
||||
if (chunk[0] === alreadyTyped[0]) {
|
||||
alreadyTyped = alreadyTyped.slice(1);
|
||||
chunk = chunk.slice(1);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
yield chunk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function getTabCompletion(
|
||||
document: vscode.TextDocument,
|
||||
pos: vscode.Position,
|
||||
token: vscode.CancellationToken,
|
||||
options: TabAutocompleteOptions
|
||||
): Promise<AutocompleteOutcome | undefined> {
|
||||
const startTime = Date.now();
|
||||
|
||||
// Filter
|
||||
const lang = languageForFilepath(document.fileName);
|
||||
const line = document.lineAt(pos).text;
|
||||
for (const endOfLine of lang.endOfLine) {
|
||||
if (line.endsWith(endOfLine) && pos.character >= endOfLine.length) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// Model
|
||||
const llm = await TabAutocompleteModel.get();
|
||||
if (!llm) return;
|
||||
|
||||
// Prompt
|
||||
const fullPrefix = document.getText(
|
||||
new vscode.Range(new vscode.Position(0, 0), pos)
|
||||
);
|
||||
const fullSuffix = document.getText(
|
||||
new vscode.Range(
|
||||
pos,
|
||||
new vscode.Position(document.lineCount, Number.MAX_SAFE_INTEGER)
|
||||
)
|
||||
);
|
||||
const lineBelowCursor = document.lineAt(
|
||||
Math.min(pos.line + 1, document.lineCount - 1)
|
||||
).text;
|
||||
const clipboardText = await vscode.env.clipboard.readText();
|
||||
const { prefix, suffix } = await constructAutocompletePrompt(
|
||||
document.uri.toString(),
|
||||
fullPrefix,
|
||||
fullSuffix,
|
||||
clipboardText,
|
||||
lang,
|
||||
getDefinition,
|
||||
options
|
||||
);
|
||||
|
||||
const { template, completionOptions } = options.template
|
||||
? { template: options.template, completionOptions: {} }
|
||||
: getTemplateForModel(llm.model);
|
||||
|
||||
const compiledTemplate = Handlebars.compile(template);
|
||||
const prompt = compiledTemplate({ prefix, suffix });
|
||||
|
||||
// Completion
|
||||
let completion = "";
|
||||
|
||||
const cache = await autocompleteCache;
|
||||
const cachedCompletion = await cache.get(prompt);
|
||||
let cacheHit = false;
|
||||
if (cachedCompletion) {
|
||||
// Cache
|
||||
cacheHit = true;
|
||||
completion = cachedCompletion;
|
||||
} else {
|
||||
setupStatusBar(true, true);
|
||||
|
||||
// Try to reuse pending requests if what the user typed matches start of completion
|
||||
let generator = GeneratorReuseManager.getGenerator(prefix, () =>
|
||||
llm.streamComplete(prompt, {
|
||||
...completionOptions,
|
||||
temperature: 0,
|
||||
raw: true,
|
||||
stop: [
|
||||
...(completionOptions?.stop || []),
|
||||
"\n\n",
|
||||
"```",
|
||||
...lang.stopWords,
|
||||
],
|
||||
})
|
||||
);
|
||||
|
||||
// LLM
|
||||
let cancelled = false;
|
||||
const generatorWithCancellation = async function* () {
|
||||
for await (const update of generator) {
|
||||
if (token.isCancellationRequested) {
|
||||
stopStatusBarLoading();
|
||||
cancelled = true;
|
||||
return undefined;
|
||||
}
|
||||
yield update;
|
||||
}
|
||||
};
|
||||
const gen2 = onlyWhitespaceAfterEndOfLine(
|
||||
generatorWithCancellation(),
|
||||
lang.endOfLine
|
||||
);
|
||||
const lineGenerator = streamWithNewLines(streamLines(gen2));
|
||||
const finalGenerator = stopAtSimilarLine(lineGenerator, lineBelowCursor);
|
||||
for await (const update of finalGenerator) {
|
||||
completion += update;
|
||||
}
|
||||
|
||||
if (cancelled) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Don't return empty
|
||||
if (completion.trim().length <= 0) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Post-processing
|
||||
completion = completion.trimEnd();
|
||||
}
|
||||
|
||||
const time = Date.now() - startTime;
|
||||
return {
|
||||
time,
|
||||
completion,
|
||||
prompt,
|
||||
modelProvider: llm.providerName,
|
||||
modelName: llm.model,
|
||||
completionOptions,
|
||||
cacheHit,
|
||||
};
|
||||
} catch (e: any) {
|
||||
console.warn("Error generating autocompletion: ", e);
|
||||
if (!ContinueCompletionProvider.errorsShown.has(e.message)) {
|
||||
ContinueCompletionProvider.errorsShown.add(e.message);
|
||||
vscode.window.showErrorMessage(e.message, "Documentation").then((val) => {
|
||||
if (val === "Documentation") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete"
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export class ContinueCompletionProvider
|
||||
implements vscode.InlineCompletionItemProvider
|
||||
{
|
||||
private static debounceTimeout: NodeJS.Timeout | undefined = undefined;
|
||||
private static debouncing: boolean = false;
|
||||
private static lastUUID: string | undefined = undefined;
|
||||
|
||||
public static errorsShown: Set<string> = new Set();
|
||||
|
||||
public async provideInlineCompletionItems(
|
||||
document: vscode.TextDocument,
|
||||
position: vscode.Position,
|
||||
context: vscode.InlineCompletionContext,
|
||||
token: vscode.CancellationToken
|
||||
//@ts-ignore
|
||||
): ProviderResult<InlineCompletionItem[] | InlineCompletionList> {
|
||||
// Debounce
|
||||
const uuid = uuidv4();
|
||||
ContinueCompletionProvider.lastUUID = uuid;
|
||||
|
||||
const config = await configHandler.loadConfig();
|
||||
const options = {
|
||||
...config.tabAutocompleteOptions,
|
||||
...DEFAULT_AUTOCOMPLETE_OPTS,
|
||||
};
|
||||
|
||||
if (ContinueCompletionProvider.debouncing) {
|
||||
ContinueCompletionProvider.debounceTimeout?.refresh();
|
||||
const lastUUID = await new Promise((resolve) =>
|
||||
setTimeout(() => {
|
||||
resolve(ContinueCompletionProvider.lastUUID);
|
||||
}, options.debounceDelay)
|
||||
);
|
||||
if (uuid !== lastUUID) {
|
||||
return [];
|
||||
}
|
||||
} else {
|
||||
ContinueCompletionProvider.debouncing = true;
|
||||
ContinueCompletionProvider.debounceTimeout = setTimeout(async () => {
|
||||
ContinueCompletionProvider.debouncing = false;
|
||||
}, options.debounceDelay);
|
||||
}
|
||||
|
||||
const enableTabAutocomplete =
|
||||
vscode.workspace
|
||||
.getConfiguration("continue")
|
||||
.get<boolean>("enableTabAutocomplete") || false;
|
||||
if (token.isCancellationRequested || !enableTabAutocomplete) {
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
const outcome = await getTabCompletion(
|
||||
document,
|
||||
position,
|
||||
token,
|
||||
options
|
||||
);
|
||||
const completion = outcome?.completion;
|
||||
|
||||
if (!completion) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Do some stuff later so as not to block return. Latency matters
|
||||
setTimeout(async () => {
|
||||
if (!outcome.cacheHit) {
|
||||
(await autocompleteCache).put(outcome.prompt, completion);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
const logRejectionTimeout = setTimeout(() => {
|
||||
// Wait 10 seconds, then assume it wasn't accepted
|
||||
outcome.accepted = false;
|
||||
ideProtocolClient.logDevData("autocomplete", outcome);
|
||||
}, 10_000);
|
||||
|
||||
return [
|
||||
new vscode.InlineCompletionItem(
|
||||
completion,
|
||||
new vscode.Range(position, position.translate(0, completion.length)),
|
||||
{
|
||||
title: "Log Autocomplete Outcome",
|
||||
command: "continue.logAutocompleteOutcome",
|
||||
arguments: [outcome, logRejectionTimeout],
|
||||
}
|
||||
),
|
||||
];
|
||||
} catch (e: any) {
|
||||
console.warn("Error getting autocompletion: ", e.message);
|
||||
} finally {
|
||||
stopStatusBarLoading();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,21 @@
|
|||
import { ContinueConfig, IDE, ILLM } from "core";
|
||||
import { ContinueConfig, ILLM, SerializedContinueConfig } from "core";
|
||||
import defaultConfig from "core/config/default";
|
||||
import {
|
||||
finalToBrowserConfig,
|
||||
intermediateToFinalConfig,
|
||||
loadFullConfigNode,
|
||||
serializedToIntermediateConfig,
|
||||
} from "core/config/load";
|
||||
import Ollama from "core/llm/llms/Ollama";
|
||||
import { getConfigJsonPath } from "core/util/paths";
|
||||
import { http, https } from "follow-redirects";
|
||||
import * as fs from "fs";
|
||||
import { Agent, ProxyAgent, fetch } from "undici";
|
||||
import { HttpProxyAgent } from "http-proxy-agent";
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import fetch from "node-fetch";
|
||||
import * as vscode from "vscode";
|
||||
import { webviewRequest } from "./debugPanel";
|
||||
import { VsCodeIde, loadFullConfigNode } from "./ideProtocol";
|
||||
import { ideProtocolClient } from "./activation/activate";
|
||||
import { debugPanelWebview, webviewRequest } from "./debugPanel";
|
||||
const tls = require("tls");
|
||||
|
||||
const outputChannel = vscode.window.createOutputChannel(
|
||||
|
|
@ -15,14 +27,71 @@ class VsCodeConfigHandler {
|
|||
|
||||
reloadConfig() {
|
||||
this.savedConfig = undefined;
|
||||
this.loadConfig();
|
||||
}
|
||||
|
||||
async loadConfig(ide: IDE): Promise<ContinueConfig> {
|
||||
if (this.savedConfig) {
|
||||
return this.savedConfig;
|
||||
private async _getWorkspaceConfigs() {
|
||||
const workspaceDirs =
|
||||
vscode.workspace.workspaceFolders?.map((folder) => folder.uri) || [];
|
||||
const configs: Partial<SerializedContinueConfig>[] = [];
|
||||
for (const workspaceDir of workspaceDirs) {
|
||||
const files = await vscode.workspace.fs.readDirectory(workspaceDir);
|
||||
for (const [filename, type] of files) {
|
||||
if (type === vscode.FileType.File && filename === ".continuerc.json") {
|
||||
const contents = await ideProtocolClient.readFile(
|
||||
vscode.Uri.joinPath(workspaceDir, filename).fsPath
|
||||
);
|
||||
configs.push(JSON.parse(contents));
|
||||
}
|
||||
}
|
||||
}
|
||||
return configs;
|
||||
}
|
||||
|
||||
async loadConfig(): Promise<ContinueConfig> {
|
||||
try {
|
||||
if (this.savedConfig) {
|
||||
return this.savedConfig;
|
||||
}
|
||||
let workspaceConfigs: any[] = [];
|
||||
try {
|
||||
workspaceConfigs = await this._getWorkspaceConfigs();
|
||||
} catch (e) {
|
||||
console.warn("Failed to load workspace configs");
|
||||
}
|
||||
this.savedConfig = await loadFullConfigNode(
|
||||
ideProtocolClient.readFile,
|
||||
workspaceConfigs
|
||||
);
|
||||
this.savedConfig.allowAnonymousTelemetry =
|
||||
this.savedConfig.allowAnonymousTelemetry &&
|
||||
vscode.workspace.getConfiguration("continue").get("telemetryEnabled");
|
||||
|
||||
// Update the sidebar panel
|
||||
const browserConfig = finalToBrowserConfig(this.savedConfig);
|
||||
debugPanelWebview?.postMessage({ type: "configUpdate", browserConfig });
|
||||
|
||||
return this.savedConfig;
|
||||
} catch (e) {
|
||||
vscode.window
|
||||
.showErrorMessage(
|
||||
"Error loading config.json. Please check your config.json file: " + e,
|
||||
"Open config.json"
|
||||
)
|
||||
.then((selection) => {
|
||||
if (selection === "Open config.json") {
|
||||
vscode.workspace
|
||||
.openTextDocument(getConfigJsonPath())
|
||||
.then((doc) => {
|
||||
vscode.window.showTextDocument(doc);
|
||||
});
|
||||
}
|
||||
});
|
||||
return intermediateToFinalConfig(
|
||||
serializedToIntermediateConfig(defaultConfig),
|
||||
ideProtocolClient.readFile
|
||||
);
|
||||
}
|
||||
this.savedConfig = await loadFullConfigNode(ide);
|
||||
return this.savedConfig;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -30,29 +99,7 @@ export const configHandler = new VsCodeConfigHandler();
|
|||
|
||||
const TIMEOUT = 7200; // 7200 seconds = 2 hours
|
||||
|
||||
export async function llmFromTitle(title?: string): Promise<ILLM> {
|
||||
let config = await configHandler.loadConfig(new VsCodeIde());
|
||||
|
||||
if (title === undefined) {
|
||||
const resp = await webviewRequest("getDefaultModelTitle");
|
||||
if (resp?.defaultModelTitle) {
|
||||
title = resp.defaultModelTitle;
|
||||
}
|
||||
}
|
||||
|
||||
let llm = title
|
||||
? config.models.find((llm) => llm.title === title)
|
||||
: config.models[0];
|
||||
if (!llm) {
|
||||
// Try to reload config
|
||||
configHandler.reloadConfig();
|
||||
config = await configHandler.loadConfig(new VsCodeIde());
|
||||
llm = config.models.find((llm) => llm.title === title);
|
||||
if (!llm) {
|
||||
throw new Error(`Unknown model ${title}`);
|
||||
}
|
||||
}
|
||||
|
||||
function setupLlm(llm: ILLM): ILLM {
|
||||
// Since we know this is happening in Node.js, we can add requestOptions through a custom agent
|
||||
const ca = [...tls.rootCertificates];
|
||||
const customCerts =
|
||||
|
|
@ -67,31 +114,26 @@ export async function llmFromTitle(title?: string): Promise<ILLM> {
|
|||
|
||||
let timeout = (llm.requestOptions?.timeout || TIMEOUT) * 1000; // measured in ms
|
||||
|
||||
const agent =
|
||||
llm.requestOptions?.proxy !== undefined
|
||||
? new ProxyAgent({
|
||||
connect: {
|
||||
ca,
|
||||
rejectUnauthorized: llm.requestOptions?.verifySsl,
|
||||
timeout,
|
||||
},
|
||||
uri: llm.requestOptions?.proxy,
|
||||
bodyTimeout: timeout,
|
||||
connectTimeout: timeout,
|
||||
headersTimeout: timeout,
|
||||
})
|
||||
: new Agent({
|
||||
connect: {
|
||||
ca,
|
||||
rejectUnauthorized: llm.requestOptions?.verifySsl,
|
||||
timeout,
|
||||
},
|
||||
bodyTimeout: timeout,
|
||||
connectTimeout: timeout,
|
||||
headersTimeout: timeout,
|
||||
});
|
||||
const agentOptions = {
|
||||
ca,
|
||||
rejectUnauthorized: llm.requestOptions?.verifySsl,
|
||||
timeout,
|
||||
sessionTimeout: timeout,
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: timeout,
|
||||
};
|
||||
|
||||
const proxy = llm.requestOptions?.proxy;
|
||||
|
||||
llm._fetch = async (input, init) => {
|
||||
// Create agent
|
||||
const protocol = new URL(input).protocol === "https:" ? https : http;
|
||||
const agent = proxy
|
||||
? new URL(input).protocol === "https:"
|
||||
? new HttpsProxyAgent(proxy, agentOptions)
|
||||
: new HttpProxyAgent(proxy, agentOptions)
|
||||
: new protocol.Agent(agentOptions);
|
||||
|
||||
const headers: { [key: string]: string } =
|
||||
llm!.requestOptions?.headers || {};
|
||||
for (const [key, value] of Object.entries(init?.headers || {})) {
|
||||
|
|
@ -100,15 +142,23 @@ export async function llmFromTitle(title?: string): Promise<ILLM> {
|
|||
|
||||
const resp = await fetch(input, {
|
||||
...init,
|
||||
dispatcher: agent,
|
||||
headers,
|
||||
agent,
|
||||
});
|
||||
|
||||
if (!resp.ok) {
|
||||
let text = await resp.text();
|
||||
if (resp.status === 404 && !resp.url.includes("/v1")) {
|
||||
text =
|
||||
"This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.";
|
||||
if (text.includes("try pulling it first")) {
|
||||
const model = JSON.parse(text).error.split(" ")[1].slice(1, -1);
|
||||
text = `The model "${model}" was not found. To download it, run \`ollama run ${model}\`.`;
|
||||
} else if (text.includes("/api/chat")) {
|
||||
text =
|
||||
"The /api/chat endpoint was not found. This may mean that you are using an older version of Ollama that does not support /api/chat. Upgrading to the latest version will solve the issue.";
|
||||
} else {
|
||||
text =
|
||||
"This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.";
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
`HTTP ${resp.status} ${resp.statusText} from ${resp.url}\n\n${text}`
|
||||
|
|
@ -128,6 +178,115 @@ export async function llmFromTitle(title?: string): Promise<ILLM> {
|
|||
|
||||
outputChannel.append(log);
|
||||
};
|
||||
|
||||
return llm;
|
||||
}
|
||||
|
||||
export async function llmFromTitle(title?: string): Promise<ILLM> {
|
||||
let config = await configHandler.loadConfig();
|
||||
|
||||
if (title === undefined) {
|
||||
const resp = await webviewRequest("getDefaultModelTitle");
|
||||
if (resp?.defaultModelTitle) {
|
||||
title = resp.defaultModelTitle;
|
||||
}
|
||||
}
|
||||
|
||||
let llm = title
|
||||
? config.models.find((llm) => llm.title === title)
|
||||
: config.models[0];
|
||||
if (!llm) {
|
||||
// Try to reload config
|
||||
configHandler.reloadConfig();
|
||||
config = await configHandler.loadConfig();
|
||||
llm = config.models.find((llm) => llm.title === title);
|
||||
if (!llm) {
|
||||
throw new Error(`Unknown model ${title}`);
|
||||
}
|
||||
}
|
||||
|
||||
return setupLlm(llm);
|
||||
}
|
||||
|
||||
export class TabAutocompleteModel {
|
||||
private static _llm: ILLM | undefined;
|
||||
private static defaultTag: string = "deepseek-coder:1.3b-base";
|
||||
|
||||
private static shownOllamaWarning: boolean = false;
|
||||
private static shownDeepseekWarning: boolean = false;
|
||||
|
||||
static clearLlm() {
|
||||
TabAutocompleteModel._llm = undefined;
|
||||
}
|
||||
|
||||
static async getDefaultTabAutocompleteModel() {
|
||||
const llm = new Ollama({
|
||||
model: TabAutocompleteModel.defaultTag,
|
||||
});
|
||||
|
||||
// Check that deepseek is already downloaded
|
||||
try {
|
||||
const models = await llm.listModels();
|
||||
if (!models.includes(TabAutocompleteModel.defaultTag)) {
|
||||
// Raise warning and explain how to download
|
||||
if (!TabAutocompleteModel.shownDeepseekWarning) {
|
||||
vscode.window
|
||||
.showWarningMessage(
|
||||
`Your local Ollama instance doesn't yet have DeepSeek Coder. To download this model, run \`ollama run deepseek-coder:1.3b-base\` (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs`,
|
||||
"Documentation",
|
||||
"Copy Command"
|
||||
)
|
||||
.then((value) => {
|
||||
if (value === "Documentation") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete"
|
||||
)
|
||||
);
|
||||
} else if (value === "Copy Command") {
|
||||
vscode.env.clipboard.writeText(
|
||||
"ollama run deepseek-coder:1.3b-base"
|
||||
);
|
||||
}
|
||||
});
|
||||
TabAutocompleteModel.shownDeepseekWarning = true;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
} catch (e) {
|
||||
if (!TabAutocompleteModel.shownOllamaWarning) {
|
||||
vscode.window
|
||||
.showWarningMessage(
|
||||
"Continue failed to connect to Ollama, which is used by default for tab-autocomplete. If you haven't downloaded it yet, you can do so at https://ollama.ai (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs",
|
||||
"Documentation"
|
||||
)
|
||||
.then((value) => {
|
||||
if (value === "Documentation") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete"
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
TabAutocompleteModel.shownOllamaWarning = true;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return llm;
|
||||
}
|
||||
|
||||
static async get() {
|
||||
if (!TabAutocompleteModel._llm) {
|
||||
const config = await configHandler.loadConfig();
|
||||
if (config.tabAutocompleteModel) {
|
||||
TabAutocompleteModel._llm = setupLlm(config.tabAutocompleteModel);
|
||||
} else {
|
||||
TabAutocompleteModel._llm =
|
||||
await TabAutocompleteModel.getDefaultTabAutocompleteModel();
|
||||
}
|
||||
}
|
||||
|
||||
return TabAutocompleteModel._llm;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
96
extensions/vscode/src/util/getTheme.ts
Normal file
96
extensions/vscode/src/util/getTheme.ts
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
import mergeJson from "core/util/merge";
|
||||
import * as fs from "fs";
|
||||
import { convertTheme } from "monaco-vscode-textmate-theme-converter/lib/cjs";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { getExtensionUri } from "./vscode";
|
||||
|
||||
const builtinThemes: any = {
|
||||
"Default Dark Modern": "dark_modern",
|
||||
"Dark+": "dark_plus",
|
||||
"Default Dark+": "dark_plus",
|
||||
"Dark (Visual Studio)": "dark_vs",
|
||||
"Visual Studio Dark": "dark_vs",
|
||||
"Dark High Contrast": "hc_black",
|
||||
"Default High Contrast": "hc_black",
|
||||
"Light High Contrast": "hc_light",
|
||||
"Default High Contrast Light": "hc_light",
|
||||
"Default Light Modern": "light_modern",
|
||||
"Light+": "light_plus",
|
||||
"Default Light+": "light_plus",
|
||||
"Light (Visual Studio)": "light_vs",
|
||||
"Visual Studio Light": "light_vs",
|
||||
};
|
||||
|
||||
function parseThemeString(themeString: string | undefined): any {
|
||||
themeString = themeString
|
||||
?.split("\n")
|
||||
.filter((line) => {
|
||||
return !line.trim().startsWith("//");
|
||||
})
|
||||
.join("\n");
|
||||
return JSON.parse(themeString || "{}");
|
||||
}
|
||||
|
||||
export function getTheme() {
|
||||
let currentTheme = undefined;
|
||||
const colorTheme =
|
||||
vscode.workspace.getConfiguration("workbench").get<string>("colorTheme") ||
|
||||
"Default Dark Modern";
|
||||
|
||||
try {
|
||||
// Pass color theme to webview for syntax highlighting
|
||||
for (let i = vscode.extensions.all.length - 1; i >= 0; i--) {
|
||||
if (currentTheme) {
|
||||
break;
|
||||
}
|
||||
const extension = vscode.extensions.all[i];
|
||||
if (extension.packageJSON?.contributes?.themes?.length > 0) {
|
||||
for (const theme of extension.packageJSON.contributes.themes) {
|
||||
if (theme.label === colorTheme) {
|
||||
const themePath = path.join(extension.extensionPath, theme.path);
|
||||
currentTheme = fs.readFileSync(themePath).toString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentTheme === undefined && builtinThemes[colorTheme]) {
|
||||
const filename = builtinThemes[colorTheme] + ".json";
|
||||
currentTheme = fs
|
||||
.readFileSync(
|
||||
path.join(getExtensionUri().fsPath, "builtin-themes", filename)
|
||||
)
|
||||
.toString();
|
||||
}
|
||||
|
||||
// Strip comments from theme
|
||||
let parsed = parseThemeString(currentTheme);
|
||||
|
||||
if (parsed.include) {
|
||||
const includeThemeString = fs
|
||||
.readFileSync(
|
||||
path.join(getExtensionUri().fsPath, "builtin-themes", parsed.include)
|
||||
)
|
||||
.toString();
|
||||
const includeTheme = parseThemeString(includeThemeString);
|
||||
parsed = mergeJson(parsed, includeTheme);
|
||||
}
|
||||
|
||||
const converted = convertTheme(parsed);
|
||||
|
||||
converted.base = (
|
||||
["vs", "hc-black"].includes(converted.base)
|
||||
? converted.base
|
||||
: colorTheme.includes("Light")
|
||||
? "vs"
|
||||
: "vs-dark"
|
||||
) as any;
|
||||
|
||||
return converted;
|
||||
} catch (e) {
|
||||
console.log("Error loading color theme: ", e);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ const vscodeGetStats = async (
|
|||
|
||||
async function getIndexesToBuild(): Promise<CodebaseIndex[]> {
|
||||
const ide = new VsCodeIde();
|
||||
const config = await configHandler.loadConfig(ide);
|
||||
const config = await configHandler.loadConfig();
|
||||
|
||||
const indexes = [
|
||||
new ChunkCodebaseIndex(ide.readFile), // Chunking must come first
|
||||
|
|
@ -42,7 +42,7 @@ export async function vsCodeIndexCodebase(workspaceDirs: string[]) {
|
|||
debugPanelWebview?.postMessage({ type: "indexProgress", progress, desc });
|
||||
};
|
||||
|
||||
const config = await configHandler.loadConfig(new VsCodeIde());
|
||||
const config = await configHandler.loadConfig();
|
||||
if (config.disableIndexing) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ export async function* traverseDirectory(
|
|||
directory: string,
|
||||
gitIgnorePatterns: string[],
|
||||
returnFiles: boolean = true,
|
||||
onlyThisDirectory?: string[]
|
||||
onlyThisDirectory: string[] | undefined
|
||||
): AsyncGenerator<string> {
|
||||
const nodes = await vscode.workspace.fs.readDirectory(
|
||||
uriFromFilePath(directory)
|
||||
|
|
|
|||
39
extensions/vscode/test.mjs
Normal file
39
extensions/vscode/test.mjs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import fetch from "node-fetch";
|
||||
|
||||
fetch(`http://localhost:11434/api/chat`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
messages: [{ role: "user", content: "Tell a story" }],
|
||||
stream: true,
|
||||
// max_tokens: 1000,
|
||||
model: "codellama:7b",
|
||||
}),
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
return response.body;
|
||||
}
|
||||
throw new Error("Network response was not ok.");
|
||||
})
|
||||
.then(async (stream) => {
|
||||
let i = 0;
|
||||
let c = "";
|
||||
for await (const chunk of stream) {
|
||||
i++;
|
||||
try {
|
||||
c += JSON.parse(chunk.toString()).message.content;
|
||||
|
||||
console.clear();
|
||||
console.log(c);
|
||||
|
||||
if (i > 40) {
|
||||
break;
|
||||
}
|
||||
} catch {
|
||||
console.log("error");
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("There has been a problem with your fetch operation:", error);
|
||||
});
|
||||
372
extensions/vscode/textmate-syntaxes/ASPVBnet.plist
Normal file
372
extensions/vscode/textmate-syntaxes/ASPVBnet.plist
Normal file
|
|
@ -0,0 +1,372 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com</string>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>vb</string>
|
||||
</array>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^~A</string>
|
||||
<key>name</key>
|
||||
<string>ASP vb.NET</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\n</string>
|
||||
<key>name</key>
|
||||
<string>meta.ending-space</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#round-brackets</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>^(?=\t)</string>
|
||||
<key>end</key>
|
||||
<string>(?=[^\t])</string>
|
||||
<key>name</key>
|
||||
<string>meta.leading-space</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.odd-tab.tabs</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.even-tab.tabs</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(\t)(\t)?</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>^(?= )</string>
|
||||
<key>end</key>
|
||||
<string>(?=[^ ])</string>
|
||||
<key>name</key>
|
||||
<string>meta.leading-space</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.odd-tab.spaces</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.even-tab.spaces</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>( )( )?</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>storage.type.function.asp</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.function.asp</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.parameters.asp</string>
|
||||
</dict>
|
||||
<key>4</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.parameter.function.asp</string>
|
||||
</dict>
|
||||
<key>5</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.parameters.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>^\s*((?i:function|sub))\s*([a-zA-Z_]\w*)\s*(\()([^)]*)(\)).*\n?</string>
|
||||
<key>name</key>
|
||||
<string>meta.function.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(^[ \t]+)?(?=')</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.whitespace.comment.leading.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?!\G)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>'</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\n</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.apostrophe.asp</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(If|Then|Else|ElseIf|Else If|End If|While|Wend|For|To|Each|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub|IIf)\b)</string>
|
||||
<key>name</key>
|
||||
<string>keyword.control.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(Mod|And|Not|Or|Xor|as)\b)</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>storage.type.asp</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.other.bfeac.asp</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.separator.comma.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?i:(dim)\s*(?:(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b)\s*(,?)))</string>
|
||||
<key>name</key>
|
||||
<string>variable.other.dim.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\s*\b(Call|Class|Const|Dim|Redim|Function|Sub|Private Sub|Public Sub|End sub|End Function|Set|Let|Get|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo)\b\s*)</string>
|
||||
<key>name</key>
|
||||
<string>storage.type.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(Private|Public|Default)\b)</string>
|
||||
<key>name</key>
|
||||
<string>storage.modifier.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\s*\b(Empty|False|Nothing|Null|True)\b)</string>
|
||||
<key>name</key>
|
||||
<string>constant.language.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>"</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>"</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.asp</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>""</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.apostrophe.asp</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.variable.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b\s*</string>
|
||||
<key>name</key>
|
||||
<string>variable.other.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(Application|ObjectContext|Request|Response|Server|Session)\b)</string>
|
||||
<key>name</key>
|
||||
<string>support.class.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\b)</string>
|
||||
<key>name</key>
|
||||
<string>support.class.collection.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\b)</string>
|
||||
<key>name</key>
|
||||
<string>support.constant.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\b)</string>
|
||||
<key>name</key>
|
||||
<string>support.function.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\b)</string>
|
||||
<key>name</key>
|
||||
<string>support.function.event.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:(?<=as )(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b))</string>
|
||||
<key>name</key>
|
||||
<string>support.type.vb.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year)\b)</string>
|
||||
<key>name</key>
|
||||
<string>support.function.vb.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>-?\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\b</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:\b(vbtrue|vbfalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant|vbDataObject|vbDecimal|vbByte|vbArray)\b)</string>
|
||||
<key>name</key>
|
||||
<string>support.type.vb.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.function.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?i:(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b)(?=\(\)?))</string>
|
||||
<key>name</key>
|
||||
<string>support.function.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?i:((?<=(\+|=|-|\&|\\|/|<|>|\(|,))\s*\b([a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?)\b(?!(\(|\.))|\b([a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?)\b(?=\s*(\+|=|-|\&|\\|/|<|>|\(|\)))))</string>
|
||||
<key>name</key>
|
||||
<string>variable.other.asp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|/=|%=|\+=|\-=|&=|\^=|\b(in|instanceof|new|delete|typeof|void)\b</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.js</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>repository</key>
|
||||
<dict>
|
||||
<key>round-brackets</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\(</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.section.round-brackets.begin.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\)</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.section.round-brackets.end.asp</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>meta.round-brackets</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>scopeName</key>
|
||||
<string>source.asp.vb.net</string>
|
||||
<key>uuid</key>
|
||||
<string>7F9C9343-D48E-4E7D-BFE8-F680714DCD3E</string>
|
||||
</dict>
|
||||
</plist>
|
||||
169
extensions/vscode/textmate-syntaxes/Batch File.tmLanguage
Normal file
169
extensions/vscode/textmate-syntaxes/Batch File.tmLanguage
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>uuid</key>
|
||||
<string>E07EC438-7B75-4437-8AA1-DA94C1E6EACC</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.command.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>\b(?i)(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\b</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.statement.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>\b(?i)(?:goto|call|exit)\b</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.conditional.if.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>\b(?i)if\s+((not)\s+)(exist|defined|errorlevel|cmdextversion)\b</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.conditional.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>\b(?i)(?:if|else)\b</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.repeat.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>\b(?i)for\b</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\b</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>comment.line.rem.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>\b(?i)rem(?:$|\s.*$)</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>comment.line.colons.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>\s*:\s*:.*$</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.parameter.function.begin.shell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>variable.parameter.function.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>(?i)(%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?\d</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.parameter.loop.begin.shell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>variable.parameter.loop.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>(?i)(%%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?[a-z]</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.other.parsetime.begin.shell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.other.parsetime.end.shell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>variable.other.parsetime.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>(%)[^%]+(%)</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.other.delayed.begin.shell</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.other.delayed.end.shell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>variable.other.delayed.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>(!)[^!]+(!)</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>"</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.shell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.shell</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.dosbatch</string>
|
||||
<key>end</key>
|
||||
<string>"|$</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.pipe.dosbatch</string>
|
||||
<key>match</key>
|
||||
<string>[|]</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.redirect.shell</string>
|
||||
<key>match</key>
|
||||
<string>&>|\d*>&\d*|\d*(>>|>|<)|\d*<&|\d*<></string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>Batch File</string>
|
||||
<key>scopeName</key>
|
||||
<string>source.dosbatch</string>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>bat</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
440
extensions/vscode/textmate-syntaxes/Clojure.tmLanguage
Normal file
440
extensions/vscode/textmate-syntaxes/Clojure.tmLanguage
Normal file
|
|
@ -0,0 +1,440 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>clj</string>
|
||||
<string>cljs</string>
|
||||
<string>clojure</string>
|
||||
</array>
|
||||
<key>foldingStartMarker</key>
|
||||
<string>\(\s*$</string>
|
||||
<key>foldingStopMarker</key>
|
||||
<string>^\s*\)</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^~C</string>
|
||||
<key>name</key>
|
||||
<string>Clojure</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#comment</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#shebang-comment</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#qouted-sexp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#sexp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#keyfn</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#string</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#vector</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#set</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#map</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#regexp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#var</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#constants</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#symbol</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#whitespace</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>repository</key>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.clojure</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(;).*$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.semicolon.clojure</string>
|
||||
</dict>
|
||||
<key>constants</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(nil)(?=(\s|\)|\]|\}))</string>
|
||||
<key>name</key>
|
||||
<string>constant.language.nil.clojure</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(true|false)</string>
|
||||
<key>name</key>
|
||||
<string>constant.language.boolean.clojure</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(\d+/\d+)</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.ratio.clojure</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(\d+r\d+)</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.arbitrary-radix.clojure</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(0x\d+)</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.hexidecimal.clojure</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(0\d+)</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.octal.clojure</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(\d+)</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.decimal.clojure</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?<=(\s|\(|\[|\{)):[a-zA-Z0-9\#\.\-\_\:\+\=\>\<\/\!\?\*]+(?=(\s|\)|\]|\}))</string>
|
||||
<key>name</key>
|
||||
<string>constant.keyword.clojure</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>keyfn</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?<=(\s|\(|\[|\{))(if(-[-a-z\?]*)?|when(-[-a-z]*)?|for(-[-a-z]*)?|cond|do|let(-[-a-z\?]*)?|binding|loop|recur|fn|throw[a-z\-]*|try|catch|finally|([a-z]*case))(?=(\s|\)|\]|\}))</string>
|
||||
<key>name</key>
|
||||
<string>storage.control.clojure</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?<=(\s|\(|\[|\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[a-z\-]*))(?=(\s|\)|\]|\}))</string>
|
||||
<key>name</key>
|
||||
<string>keyword.control.clojure</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>map</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(\{)</string>
|
||||
<key>end</key>
|
||||
<string>(\})</string>
|
||||
<key>name</key>
|
||||
<string>meta.map.clojure</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>qouted-sexp</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(['``]\()</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.section.expression.begin.clojure</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(\))(\n)?</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.section.expression.end.clojure</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.after-expression.clojure</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>meta.qouted-expression.clojure</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>regexp</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>#\"</string>
|
||||
<key>end</key>
|
||||
<string>\"</string>
|
||||
<key>name</key>
|
||||
<string>string.regexp.clojure</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#regexp_escaped_char</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>regexp_escaped_char</key>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\(\")</string>
|
||||
<key>name</key>
|
||||
<string>string.regexp.clojure</string>
|
||||
</dict>
|
||||
<key>set</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(\#\{)</string>
|
||||
<key>end</key>
|
||||
<string>(\})</string>
|
||||
<key>name</key>
|
||||
<string>meta.set.clojure</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>sexp</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(\()</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.section.expression.begin.clojure</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(\))(\n)?</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.section.expression.end.clojure</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.after-expression.clojure</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>meta.expression.clojure</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<=\()(ns|def|def-|defn|defn-|defvar|defvar-|defmacro|defmacro-|deftest)\s+(.+?)(?=\s)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.clojure</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.global.clojure</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(?=\))</string>
|
||||
<key>name</key>
|
||||
<string>meta.definition.global.clojure</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>shebang-comment</key>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.shebang.clojure</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>^(\#!).*$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.semicolon.clojure</string>
|
||||
</dict>
|
||||
<key>string</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(")</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.clojure</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(")</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.clojure</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.clojure</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\.</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.clojure</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>symbol</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(\w[\w\d]+)</string>
|
||||
<key>name</key>
|
||||
<string>meta.symbol.clojure</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>var</key>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?<=(\s|\(|\[|\{)\#)'[a-zA-Z0-9\.\-\_\:\+\=\>\<\/\!\?\*]+(?=(\s|\)|\]|\}))</string>
|
||||
<key>name</key>
|
||||
<string>meta.var.clojure</string>
|
||||
</dict>
|
||||
<key>vector</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(\[)</string>
|
||||
<key>end</key>
|
||||
<string>(\])</string>
|
||||
<key>name</key>
|
||||
<string>meta.vector.clojure</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>whitespace</key>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\s+$</string>
|
||||
<key>name</key>
|
||||
<string>invalid.trailing-whitespace</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>scopeName</key>
|
||||
<string>source.clojure</string>
|
||||
<key>smartTypingPairs</key>
|
||||
<array>
|
||||
<array>
|
||||
<string>"</string>
|
||||
<string>"</string>
|
||||
</array>
|
||||
<array>
|
||||
<string>(</string>
|
||||
<string>)</string>
|
||||
</array>
|
||||
<array>
|
||||
<string>{</string>
|
||||
<string>}</string>
|
||||
</array>
|
||||
<array>
|
||||
<string>[</string>
|
||||
<string>]</string>
|
||||
</array>
|
||||
</array>
|
||||
<key>uuid</key>
|
||||
<string>6A87759F-F746-4E84-B788-965B46363202</string>
|
||||
</dict>
|
||||
</plist>
|
||||
143
extensions/vscode/textmate-syntaxes/Dockerfile.tmLanguage
Normal file
143
extensions/vscode/textmate-syntaxes/Dockerfile.tmLanguage
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>Dockerfile</string>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>Dockerfile</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.dockerfile</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.special-method.dockerfile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>^\s*(?:(ONBUILD)\s+)?(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|VOLUME|USER|WORKDIR|COPY|LABEL|STOPSIGNAL|ARG)\s</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.dockerfile</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.other.special-method.dockerfile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>^\s*(?:(ONBUILD)\s+)?(CMD|ENTRYPOINT)\s</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>"</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.dockerfile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>"</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.dockerfile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.dockerfile</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\.</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escaped.dockerfile</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>'</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.dockerfile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>'</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.dockerfile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.single.dockerfile</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\.</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escaped.dockerfile</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.whitespace.comment.leading.dockerfile</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>comment.line.number-sign.dockerfile</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.dockerfile</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>comment</key>
|
||||
<string>comment.line</string>
|
||||
<key>match</key>
|
||||
<string>^(\s*)((#).*$\n?)</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>scopeName</key>
|
||||
<string>source.dockerfile</string>
|
||||
<key>uuid</key>
|
||||
<string>a39d8795-59d2-49af-aa00-fe74ee29576e</string>
|
||||
</dict>
|
||||
</plist>
|
||||
2145
extensions/vscode/textmate-syntaxes/Groovy.tmLanguage
Normal file
2145
extensions/vscode/textmate-syntaxes/Groovy.tmLanguage
Normal file
File diff suppressed because it is too large
Load diff
854
extensions/vscode/textmate-syntaxes/Handlebars.json
Normal file
854
extensions/vscode/textmate-syntaxes/Handlebars.json
Normal file
|
|
@ -0,0 +1,854 @@
|
|||
{
|
||||
"name": "Handlebars",
|
||||
"repository": {
|
||||
"html_tags": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(<)([a-zA-Z0-9:-]+)(?=[^>]*></\\2>)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.html"
|
||||
}
|
||||
},
|
||||
"end": "(>(<)/)(\\2)(>)",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "meta.scope.between-tag-pair.html"
|
||||
},
|
||||
"3": {
|
||||
"name": "entity.name.tag.html"
|
||||
},
|
||||
"4": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
}
|
||||
},
|
||||
"name": "meta.tag.any.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag-stuff"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(<\\?)(xml)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.xml.html"
|
||||
}
|
||||
},
|
||||
"end": "(\\?>)",
|
||||
"name": "meta.tag.preprocessor.xml.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_generic_attribute"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "<!--",
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.html"
|
||||
}
|
||||
},
|
||||
"end": "--\\s*>",
|
||||
"name": "comment.block.html",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "--",
|
||||
"name": "invalid.illegal.bad-comments-or-CDATA.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "<!",
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
}
|
||||
},
|
||||
"end": ">",
|
||||
"name": "meta.tag.sgml.html",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(DOCTYPE|doctype)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.tag.doctype.html"
|
||||
}
|
||||
},
|
||||
"end": "(?=>)",
|
||||
"name": "meta.tag.sgml.doctype.html",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\"[^\">]*\"",
|
||||
"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\[CDATA\\[",
|
||||
"end": "]](?=>)",
|
||||
"name": "constant.other.inline-data.html"
|
||||
},
|
||||
{
|
||||
"match": "(\\s*)(?!--|>)\\S(\\s*)",
|
||||
"name": "invalid.illegal.bad-comments-or-CDATA.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.style.html"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
}
|
||||
},
|
||||
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
|
||||
"name": "source.css.embedded.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag-stuff"
|
||||
},
|
||||
{
|
||||
"begin": "(>)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
}
|
||||
},
|
||||
"end": "(?=</(?i:style))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.css"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.script.html"
|
||||
}
|
||||
},
|
||||
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
|
||||
"endCaptures": {
|
||||
"2": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
}
|
||||
},
|
||||
"name": "source.js.embedded.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag-stuff"
|
||||
},
|
||||
{
|
||||
"begin": "(?<!</(?:script|SCRIPT))(>)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.script.html"
|
||||
}
|
||||
},
|
||||
"end": "(</)((?i:script))",
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.comment.js"
|
||||
}
|
||||
},
|
||||
"match": "(//).*?((?=</script)|$\\n?)",
|
||||
"name": "comment.line.double-slash.js"
|
||||
},
|
||||
{
|
||||
"begin": "/\\*",
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.js"
|
||||
}
|
||||
},
|
||||
"end": "\\*/|(?=</script)",
|
||||
"name": "comment.block.js"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(</?)((?i:body|head|html)\\b)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.structure.any.html"
|
||||
}
|
||||
},
|
||||
"end": "(>)",
|
||||
"name": "meta.tag.structure.any.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag-stuff"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(</?)((?i:address|blockquote|dd|div|header|section|footer|aside|nav|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\\b)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.block.any.html"
|
||||
}
|
||||
},
|
||||
"end": "(>)",
|
||||
"name": "meta.tag.block.any.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag-stuff"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.inline.any.html"
|
||||
}
|
||||
},
|
||||
"end": "((?: ?/)?>)",
|
||||
"name": "meta.tag.inline.any.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag-stuff"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(</?)([a-zA-Z0-9:-]+)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.other.html"
|
||||
}
|
||||
},
|
||||
"end": "(>)",
|
||||
"name": "meta.tag.other.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag-stuff"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(</?)([a-zA-Z0-9{}:-]+)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.tokenised.html"
|
||||
}
|
||||
},
|
||||
"end": "(>)",
|
||||
"name": "meta.tag.tokenised.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag-stuff"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#entities"
|
||||
},
|
||||
{
|
||||
"match": "<>",
|
||||
"name": "invalid.illegal.incomplete.html"
|
||||
},
|
||||
{
|
||||
"match": "<",
|
||||
"name": "invalid.illegal.bad-angle-bracket.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
"entities": {
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.entity.html"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.entity.html"
|
||||
}
|
||||
},
|
||||
"name": "constant.character.entity.html",
|
||||
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
|
||||
},
|
||||
{
|
||||
"name": "invalid.illegal.bad-ampersand.html",
|
||||
"match": "&"
|
||||
}
|
||||
]
|
||||
},
|
||||
"end_block": {
|
||||
"begin": "(\\{\\{~?/)([a-zA-Z0-9_\\.-]+)\\s*",
|
||||
"end": "(~?\\}\\})",
|
||||
"name": "meta.function.block.end.handlebars",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "support.constant.handlebars"
|
||||
}
|
||||
},
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "support.constant.handlebars"
|
||||
},
|
||||
"2": {
|
||||
"name": "support.constant.handlebars"
|
||||
}
|
||||
},
|
||||
"patterns": []
|
||||
},
|
||||
"yfm": {
|
||||
"patterns": [
|
||||
{
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.yaml"
|
||||
}
|
||||
],
|
||||
"begin": "(?<!\\s)---\\n$",
|
||||
"end": "^---\\s",
|
||||
"name": "markup.raw.yaml.front-matter"
|
||||
}
|
||||
]
|
||||
},
|
||||
"comments": {
|
||||
"patterns": [
|
||||
{
|
||||
"patterns": [
|
||||
{
|
||||
"name": "keyword.annotation.handlebars",
|
||||
"match": "@\\w*"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
}
|
||||
],
|
||||
"begin": "\\{\\{!",
|
||||
"end": "\\}\\}",
|
||||
"name": "comment.block.handlebars"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.html"
|
||||
}
|
||||
},
|
||||
"begin": "<!--",
|
||||
"end": "-{2,3}\\s*>",
|
||||
"name": "comment.block.html",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "invalid.illegal.bad-comments-or-CDATA.html",
|
||||
"match": "--"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"block_comments": {
|
||||
"patterns": [
|
||||
{
|
||||
"patterns": [
|
||||
{
|
||||
"name": "keyword.annotation.handlebars",
|
||||
"match": "@\\w*"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
}
|
||||
],
|
||||
"begin": "\\{\\{!--",
|
||||
"end": "--\\}\\}",
|
||||
"name": "comment.block.handlebars"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.html"
|
||||
}
|
||||
},
|
||||
"begin": "<!--",
|
||||
"end": "-{2,3}\\s*>",
|
||||
"name": "comment.block.html",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "invalid.illegal.bad-comments-or-CDATA.html",
|
||||
"match": "--"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"block_helper": {
|
||||
"begin": "(\\{\\{~?\\#)([-a-zA-Z0-9_\\./]+)\\s?(@?[-a-zA-Z0-9_\\./]+)*\\s?(@?[-a-zA-Z0-9_\\./]+)*\\s?(@?[-a-zA-Z0-9_\\./]+)*",
|
||||
"end": "(~?\\}\\})",
|
||||
"name": "meta.function.block.start.handlebars",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "support.constant.handlebars"
|
||||
}
|
||||
},
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "support.constant.handlebars"
|
||||
},
|
||||
"2": {
|
||||
"name": "support.constant.handlebars"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.parameter.handlebars"
|
||||
},
|
||||
"4": {
|
||||
"name": "support.constant.handlebars"
|
||||
},
|
||||
"5": {
|
||||
"name": "variable.parameter.handlebars"
|
||||
},
|
||||
"6": {
|
||||
"name": "support.constant.handlebars"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#handlebars_attribute"
|
||||
}
|
||||
]
|
||||
},
|
||||
"string-single-quoted": {
|
||||
"begin": "'",
|
||||
"end": "'",
|
||||
"name": "string.quoted.single.handlebars",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.html"
|
||||
}
|
||||
},
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.html"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#escaped-single-quote"
|
||||
},
|
||||
{
|
||||
"include": "#block_comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
{
|
||||
"include": "#block_helper"
|
||||
},
|
||||
{
|
||||
"include": "#else_token"
|
||||
},
|
||||
{
|
||||
"include": "#end_block"
|
||||
},
|
||||
{
|
||||
"include": "#partial_and_var"
|
||||
}
|
||||
]
|
||||
},
|
||||
"string": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string-single-quoted"
|
||||
},
|
||||
{
|
||||
"include": "#string-double-quoted"
|
||||
}
|
||||
]
|
||||
},
|
||||
"escaped-single-quote": {
|
||||
"name": "constant.character.escape.js",
|
||||
"match": "\\\\'"
|
||||
},
|
||||
"escaped-double-quote": {
|
||||
"name": "constant.character.escape.js",
|
||||
"match": "\\\\\""
|
||||
},
|
||||
"partial_and_var": {
|
||||
"begin": "(\\{\\{~?\\{*(>|!<)*)\\s*(@?[-a-zA-Z0-9_\\./]+)*",
|
||||
"end": "(~?\\}\\}\\}*)",
|
||||
"name": "meta.function.inline.other.handlebars",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "support.constant.handlebars"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.parameter.handlebars"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "support.constant.handlebars"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#handlebars_attribute"
|
||||
}
|
||||
]
|
||||
},
|
||||
"handlebars_attribute_name": {
|
||||
"begin": "\\b([-a-zA-Z0-9_\\.]+)\\b=",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "variable.parameter.handlebars"
|
||||
}
|
||||
},
|
||||
"end": "(?='|\"|)",
|
||||
"name": "entity.other.attribute-name.handlebars"
|
||||
},
|
||||
"handlebars_attribute_value": {
|
||||
"begin": "([-a-zA-Z0-9_\\./]+)\\b\\s*",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "variable.parameter.handlebars"
|
||||
}
|
||||
},
|
||||
"end": "('|\"|)",
|
||||
"name": "entity.other.attribute-value.handlebars",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"handlebars_attribute": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#handlebars_attribute_name"
|
||||
},
|
||||
{
|
||||
"include": "#handlebars_attribute_value"
|
||||
}
|
||||
]
|
||||
},
|
||||
"extends": {
|
||||
"patterns": [
|
||||
{
|
||||
"end": "(\\}\\})",
|
||||
"begin": "(\\{\\{!<)\\s([-a-zA-Z0-9_\\./]+)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "support.function.handlebars"
|
||||
},
|
||||
"2": {
|
||||
"name": "support.class.handlebars"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "support.function.handlebars"
|
||||
}
|
||||
},
|
||||
"name": "meta.preprocessor.handlebars"
|
||||
}
|
||||
]
|
||||
},
|
||||
"else_token": {
|
||||
"begin": "(\\{\\{~?else)(@?\\s(if)\\s([-a-zA-Z0-9_\\./]+))?",
|
||||
"end": "(~?\\}\\}\\}*)",
|
||||
"name": "meta.function.inline.else.handlebars",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "support.constant.handlebars"
|
||||
},
|
||||
"3": {
|
||||
"name": "support.constant.handlebars"
|
||||
},
|
||||
"4": {
|
||||
"name": "variable.parameter.handlebars"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "support.constant.handlebars"
|
||||
}
|
||||
}
|
||||
},
|
||||
"string-double-quoted": {
|
||||
"begin": "\"",
|
||||
"end": "\"",
|
||||
"name": "string.quoted.double.handlebars",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.html"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.html"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#escaped-double-quote"
|
||||
},
|
||||
{
|
||||
"include": "#block_comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
{
|
||||
"include": "#block_helper"
|
||||
},
|
||||
{
|
||||
"include": "#else_token"
|
||||
},
|
||||
{
|
||||
"include": "#end_block"
|
||||
},
|
||||
{
|
||||
"include": "#partial_and_var"
|
||||
}
|
||||
]
|
||||
},
|
||||
"inline_script": {
|
||||
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?:.*(type)=([\"'](?:text/x-handlebars-template|text/x-handlebars|text/template|x-tmpl-handlebars)[\"']))(?![^>]*/>)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.script.html"
|
||||
},
|
||||
"3": {
|
||||
"name": "entity.other.attribute-name.html"
|
||||
},
|
||||
"4": {
|
||||
"name": "string.quoted.double.html"
|
||||
}
|
||||
},
|
||||
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
|
||||
"endCaptures": {
|
||||
"2": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
}
|
||||
},
|
||||
"name": "source.handlebars.embedded.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag-stuff"
|
||||
},
|
||||
{
|
||||
"begin": "(?<!</(?:script|SCRIPT))(>)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.script.html"
|
||||
}
|
||||
},
|
||||
"end": "(</)((?i:script))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block_comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
{
|
||||
"include": "#block_helper"
|
||||
},
|
||||
{
|
||||
"include": "#end_block"
|
||||
},
|
||||
{
|
||||
"include": "#else_token"
|
||||
},
|
||||
{
|
||||
"include": "#partial_and_var"
|
||||
},
|
||||
{
|
||||
"include": "#html_tags"
|
||||
},
|
||||
{
|
||||
"include": "text.html.basic"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tag_generic_attribute": {
|
||||
"begin": "\\b([a-zA-Z0-9_-]+)\\b\\s*(=)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.other.attribute-name.generic.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.separator.key-value.html"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
}
|
||||
],
|
||||
"name": "entity.other.attribute-name.html",
|
||||
"end": "(?<='|\"|)"
|
||||
},
|
||||
"tag_id_attribute": {
|
||||
"begin": "\\b(id)\\b\\s*(=)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.other.attribute-name.id.html"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.separator.key-value.html"
|
||||
}
|
||||
},
|
||||
"end": "(?<='|\"|)",
|
||||
"name": "meta.attribute-with-value.id.html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tag-stuff": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_id_attribute"
|
||||
},
|
||||
{
|
||||
"include": "#tag_generic_attribute"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#block_comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
{
|
||||
"include": "#block_helper"
|
||||
},
|
||||
{
|
||||
"include": "#end_block"
|
||||
},
|
||||
{
|
||||
"include": "#else_token"
|
||||
},
|
||||
{
|
||||
"include": "#partial_and_var"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scopeName": "text.html.handlebars",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#yfm"
|
||||
},
|
||||
{
|
||||
"include": "#extends"
|
||||
},
|
||||
{
|
||||
"include": "#block_comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
{
|
||||
"include": "#block_helper"
|
||||
},
|
||||
{
|
||||
"include": "#end_block"
|
||||
},
|
||||
{
|
||||
"include": "#else_token"
|
||||
},
|
||||
{
|
||||
"include": "#partial_and_var"
|
||||
},
|
||||
{
|
||||
"include": "#inline_script"
|
||||
},
|
||||
{
|
||||
"include": "#html_tags"
|
||||
},
|
||||
{
|
||||
"include": "text.html.basic"
|
||||
}
|
||||
],
|
||||
"fileTypes": [
|
||||
"handlebars",
|
||||
"handlebars.html",
|
||||
"hbr",
|
||||
"hbrs",
|
||||
"hbs",
|
||||
"hdbs",
|
||||
"hjs",
|
||||
"mu",
|
||||
"mustache",
|
||||
"rac",
|
||||
"stache",
|
||||
"template",
|
||||
"tmpl"
|
||||
],
|
||||
"uuid": "70E91676-DE0A-4266-A2B9-3AD2E535E484",
|
||||
"version": "https://github.com/daaain/Handlebars/commit/bdaec7aaf5eaac45d1878096110d1db7975fb100"
|
||||
}
|
||||
387
extensions/vscode/textmate-syntaxes/JSON.tmLanguage
Normal file
387
extensions/vscode/textmate-syntaxes/JSON.tmLanguage
Normal file
|
|
@ -0,0 +1,387 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>json</string>
|
||||
<string>sublime-settings</string>
|
||||
<string>sublime-menu</string>
|
||||
<string>sublime-keymap</string>
|
||||
<string>sublime-mousemap</string>
|
||||
<string>sublime-theme</string>
|
||||
<string>sublime-build</string>
|
||||
<string>sublime-project</string>
|
||||
<string>sublime-completions</string>
|
||||
</array>
|
||||
<key>foldingStartMarker</key>
|
||||
<string>(?x) # turn on extended mode
|
||||
^ # a line beginning with
|
||||
\s* # some optional space
|
||||
[{\[] # the start of an object or array
|
||||
(?! # but not followed by
|
||||
.* # whatever
|
||||
[}\]] # and the close of an object or array
|
||||
,? # an optional comma
|
||||
\s* # some optional space
|
||||
$ # at the end of the line
|
||||
)
|
||||
| # ...or...
|
||||
[{\[] # the start of an object or array
|
||||
\s* # some optional space
|
||||
$ # at the end of the line</string>
|
||||
<key>foldingStopMarker</key>
|
||||
<string>(?x) # turn on extended mode
|
||||
^ # a line beginning with
|
||||
\s* # some optional space
|
||||
[}\]] # and the close of an object or array</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^~J</string>
|
||||
<key>name</key>
|
||||
<string>JSON (Javascript Next)</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#value</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>repository</key>
|
||||
<dict>
|
||||
<key>array</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\[</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.array.begin.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\]</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.array.end.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>meta.structure.array.json</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#value</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>,</string>
|
||||
<key>name</key>
|
||||
<string>punctuation.separator.array.json</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>[^\s\]]</string>
|
||||
<key>name</key>
|
||||
<string>invalid.illegal.expected-array-separator.json</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>comments</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>/\*\*</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\*/</string>
|
||||
<key>name</key>
|
||||
<string>comment.block.documentation.json</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>/\*</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\*/</string>
|
||||
<key>name</key>
|
||||
<string>comment.block.json</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(//).*$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.double-slash.js</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>constant</key>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(?:true|false|null)\b</string>
|
||||
<key>name</key>
|
||||
<string>constant.language.json</string>
|
||||
</dict>
|
||||
<key>number</key>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x) # turn on extended mode
|
||||
-? # an optional minus
|
||||
(?:
|
||||
0 # a zero
|
||||
| # ...or...
|
||||
[1-9] # a 1-9 character
|
||||
\d* # followed by zero or more digits
|
||||
)
|
||||
(?:
|
||||
(?:
|
||||
\. # a period
|
||||
\d+ # followed by one or more digits
|
||||
)?
|
||||
(?:
|
||||
[eE] # an e character
|
||||
[+-]? # followed by an option +/-
|
||||
\d+ # followed by one or more digits
|
||||
)? # make exponent optional
|
||||
)? # make decimal portion optional</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.json</string>
|
||||
</dict>
|
||||
<key>object</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\{</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.dictionary.begin.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\}</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.dictionary.end.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>meta.structure.dictionary.json</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>the JSON object key</string>
|
||||
<key>include</key>
|
||||
<string>#objectkey</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#comments</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>:</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.separator.dictionary.key-value.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>(,)|(?=\})</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.separator.dictionary.pair.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>meta.structure.dictionary.value.json</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>comment</key>
|
||||
<string>the JSON object value</string>
|
||||
<key>include</key>
|
||||
<string>#value</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>[^\s,]</string>
|
||||
<key>name</key>
|
||||
<string>invalid.illegal.expected-dictionary-separator.json</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>[^\s\}]</string>
|
||||
<key>name</key>
|
||||
<string>invalid.illegal.expected-dictionary-separator.json</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>string</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>"</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>"</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.json</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#stringcontent</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>objectkey</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>"</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.support.type.property-name.begin.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>"</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.support.type.property-name.end.json</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>support.type.property-name.json</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#stringcontent</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>stringcontent</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x) # turn on extended mode
|
||||
\\ # a literal backslash
|
||||
(?: # ...followed by...
|
||||
["\\/bfnrt] # one of these characters
|
||||
| # ...or...
|
||||
u # a u
|
||||
[0-9a-fA-F]{4}) # and four hex digits</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.json</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\.</string>
|
||||
<key>name</key>
|
||||
<string>invalid.illegal.unrecognized-string-escape.json</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>value</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#constant</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#number</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#string</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#array</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#object</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#comments</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>scopeName</key>
|
||||
<string>source.json</string>
|
||||
<key>uuid</key>
|
||||
<string>8f97457b-516e-48ce-83c7-08ae12fb327a</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
964
extensions/vscode/textmate-syntaxes/Jade.json
Normal file
964
extensions/vscode/textmate-syntaxes/Jade.json
Normal file
|
|
@ -0,0 +1,964 @@
|
|||
{
|
||||
"fileTypes": [
|
||||
"jade"
|
||||
],
|
||||
"name": "Jade",
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Doctype declaration.",
|
||||
"match": "^(!!!|doctype)(\\s*[a-zA-Z0-9-_]+)?",
|
||||
"name": "meta.tag.sgml.doctype.html"
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*)//-",
|
||||
"comment": "Unbuffered (jade-only) comments.",
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"name": "comment.unbuffered.block.jade"
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*)//",
|
||||
"comment": "Buffered (html) comments.",
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"name": "string.comment.buffered.block.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "invalid.illegal.comment.comment.block.jade"
|
||||
}
|
||||
},
|
||||
"comment": "Buffered comments inside buffered comments will generate invalid html.",
|
||||
"match": "^\\s*(//)(?!-)",
|
||||
"name": "string.comment.buffered.block.jade"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*)-$",
|
||||
"comment": "Unbuffered code block.",
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"name": "source.js",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*)(script)(?=[.#(\\s])((?![^\\n]*type=)|(?=[^\\n]*(text|application)/javascript))",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "entity.name.tag.script.jade"
|
||||
}
|
||||
},
|
||||
"comment": "Script tag with JavaScript code.",
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"name": "meta.tag.other",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G(?=\\()",
|
||||
"end": "$",
|
||||
"name": "stuff.tag.script.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\G(?=[.#])",
|
||||
"end": "$",
|
||||
"name": "stuff.tag.script.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#complete_tag"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*)(style)((\\.$)|(?=[.#(].*\\.$))",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "entity.name.tag.script.jade"
|
||||
}
|
||||
},
|
||||
"comment": "Style tag with CSS code.",
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"name": "meta.tag.other",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G(?=\\()",
|
||||
"end": "$",
|
||||
"name": "stuff.tag.style.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\G(?=[.#])",
|
||||
"end": "$",
|
||||
"name": "stuff.tag.style.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#complete_tag"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "source.css"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*):(sass)(?=\\(|$)",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "constant.language.name.sass.filter.jade"
|
||||
}
|
||||
},
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"name": "source.sass.filter.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
},
|
||||
{
|
||||
"include": "source.sass"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*):(less)(?=\\(|$)",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "constant.language.name.less.filter.jade"
|
||||
}
|
||||
},
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"name": "source.less.filter.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
},
|
||||
{
|
||||
"include": "source.less"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*):(stylus)(?=\\(|$)",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "constant.language.name.stylus.filter.jade"
|
||||
}
|
||||
},
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
},
|
||||
{
|
||||
"include": "source.stylus"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*):(coffee(-?script)?)(?=\\(|$)",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "constant.language.name.coffeescript.filter.jade"
|
||||
}
|
||||
},
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"name": "source.coffeescript.filter.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
},
|
||||
{
|
||||
"include": "source.coffee"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*)((:(?=.))|(:$))",
|
||||
"beginCaptures": {
|
||||
"4": {
|
||||
"name": "invalid.illegal.empty.generic.filter.jade"
|
||||
}
|
||||
},
|
||||
"comment": "Generic Jade filter.",
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G(?<=:)(?=.)",
|
||||
"end": "$",
|
||||
"name": "name.generic.filter.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\G\\(",
|
||||
"name": "invalid.illegal.name.generic.filter.jade"
|
||||
},
|
||||
{
|
||||
"match": "[\\w-]",
|
||||
"name": "constant.language.name.generic.filter.jade"
|
||||
},
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
},
|
||||
{
|
||||
"match": "\\W",
|
||||
"name": "invalid.illegal.name.generic.filter.jade"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(\\s*)(?=[\\w.#].*?\\.$)(?=(?:(?:(?:(?:(?:#[\\w-]+)|(?:\\.[\\w-]+))|(?:(?:[#!]\\{[^}]*\\})|(?:\\w(?:(?:[\\w:-]+[\\w-])|(?:[\\w-]*)))))(?:(?:#[\\w-]+)|(?:\\.[\\w-]+)|(?:\\((?:[^()\\'\\\"]*(?:(?:\\'(?:[^\\']|(?:(?<!\\\\)\\\\\\'))*\\')|(?:\\\"(?:[^\\\"]|(?:(?<!\\\\)\\\\\\\"))*\\\")))*[^()]*\\))*)*)(?:(?:(?::\\s+)|(?<=\\)))(?:(?:(?:(?:#[\\w-]+)|(?:\\.[\\w-]+))|(?:(?:[#!]\\{[^}]*\\})|(?:\\w(?:(?:[\\w:-]+[\\w-])|(?:[\\w-]*)))))(?:(?:#[\\w-]+)|(?:\\.[\\w-]+)|(?:\\((?:[^()\\'\\\"]*(?:(?:\\'(?:[^\\']|(?:(?<!\\\\)\\\\\\'))*\\')|(?:\\\"(?:[^\\\"]|(?:(?<!\\\\)\\\\\\\"))*\\\")))*[^()]*\\))*)*))*)\\.$)(?:(?:(#[\\w-]+)|(\\.[\\w-]+))|((?:[#!]\\{[^}]*\\})|(?:\\w(?:(?:[\\w:-]+[\\w-])|(?:[\\w-]*)))))",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "constant.id.tag.jade"
|
||||
},
|
||||
"3": {
|
||||
"name": "constant.language.js"
|
||||
},
|
||||
"4": {
|
||||
"name": "meta.tag.other entity.name.tag.jade"
|
||||
}
|
||||
},
|
||||
"comment": "Generated from dot_block_tag.py",
|
||||
"end": "^(?!(\\1\\s)|\\s*$)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
},
|
||||
{
|
||||
"include": "#complete_tag"
|
||||
},
|
||||
{
|
||||
"begin": "^(?=.)",
|
||||
"end": "$",
|
||||
"name": "text.block.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline_jade"
|
||||
},
|
||||
{
|
||||
"include": "#embedded_html"
|
||||
},
|
||||
{
|
||||
"include": "#html_entity"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_value"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_error"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^\\s*",
|
||||
"comment": "All constructs that generally span a single line starting with any number of white-spaces.",
|
||||
"end": "$",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline_jade"
|
||||
},
|
||||
{
|
||||
"include": "#blocks_and_includes"
|
||||
},
|
||||
{
|
||||
"include": "#unbuffered_code"
|
||||
},
|
||||
{
|
||||
"include": "#mixin_definition"
|
||||
},
|
||||
{
|
||||
"include": "#mixin_call"
|
||||
},
|
||||
{
|
||||
"include": "#flow_control"
|
||||
},
|
||||
{
|
||||
"include": "#case_conds"
|
||||
},
|
||||
{
|
||||
"begin": "\\|",
|
||||
"comment": "Tag pipe text line.",
|
||||
"end": "$",
|
||||
"name": "text.block.pipe.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline_jade"
|
||||
},
|
||||
{
|
||||
"include": "#embedded_html"
|
||||
},
|
||||
{
|
||||
"include": "#html_entity"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_value"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_error"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#printed_expression"
|
||||
},
|
||||
{
|
||||
"begin": "\\G(?=(#[^\\{\\w-])|[^\\w.#])",
|
||||
"comment": "Line starting with characters incompatible with tag name/id/class is standalone text.",
|
||||
"end": "$",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "</?(?=[!#])",
|
||||
"end": ">|$",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline_jade"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_value"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_error"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#inline_jade"
|
||||
},
|
||||
{
|
||||
"include": "#embedded_html"
|
||||
},
|
||||
{
|
||||
"include": "#html_entity"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_value"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_error"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#complete_tag"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"blocks_and_includes": {
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.type.import.include.jade"
|
||||
},
|
||||
"4": {
|
||||
"name": "variable.control.import.include.jade"
|
||||
}
|
||||
},
|
||||
"comment": "Template blocks and includes.",
|
||||
"match": "(extends|include|yield|append|prepend|block( (append|prepend))?)\\s+(.*)$",
|
||||
"name": "meta.first-class.jade"
|
||||
},
|
||||
"case_conds": {
|
||||
"begin": "(default|when)((\\s+|(?=:))|$)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.type.function.jade"
|
||||
}
|
||||
},
|
||||
"comment": "Jade case conditionals.",
|
||||
"end": "$",
|
||||
"name": "meta.control.flow.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G(?!:)",
|
||||
"end": "(?=:\\s+)|$",
|
||||
"name": "js.embedded.control.flow.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#case_when_paren"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": ":\\s+",
|
||||
"end": "$",
|
||||
"name": "tag.case.control.flow.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#complete_tag"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"case_when_paren": {
|
||||
"begin": "\\(",
|
||||
"end": "\\)",
|
||||
"name": "js.when.control.flow.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#case_when_paren"
|
||||
},
|
||||
{
|
||||
"match": ":",
|
||||
"name": "invalid.illegal.name.tag.jade"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
"complete_tag": {
|
||||
"begin": "(?=[\\w.#])|(:\\s*)",
|
||||
"end": "(\\.?$)|(?=:.)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#blocks_and_includes"
|
||||
},
|
||||
{
|
||||
"include": "#unbuffered_code"
|
||||
},
|
||||
{
|
||||
"include": "#mixin_call"
|
||||
},
|
||||
{
|
||||
"include": "#flow_control"
|
||||
},
|
||||
{
|
||||
"match": "(?<=:)\\w.*$",
|
||||
"name": "invalid.illegal.name.tag.jade"
|
||||
},
|
||||
{
|
||||
"include": "#tag_name"
|
||||
},
|
||||
{
|
||||
"include": "#tag_id"
|
||||
},
|
||||
{
|
||||
"include": "#tag_classes"
|
||||
},
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
},
|
||||
{
|
||||
"include": "#tag_mixin_attributes"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"2": {
|
||||
"name": "invalid.illegal.end.tag.jade"
|
||||
},
|
||||
"4": {
|
||||
"name": "invalid.illegal.end.tag.jade"
|
||||
}
|
||||
},
|
||||
"match": "((\\.)\\s+$)|((:)\\s*$)"
|
||||
},
|
||||
{
|
||||
"include": "#printed_expression"
|
||||
},
|
||||
{
|
||||
"include": "#tag_text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"embedded_html": {
|
||||
"begin": "(?=<[^>]*>)",
|
||||
"end": "$|(?=>)",
|
||||
"name": "html",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "text.html.basic"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_value"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_error"
|
||||
}
|
||||
]
|
||||
},
|
||||
"flow_control": {
|
||||
"begin": "(for|if|else if|else|each|until|while|unless|case)(\\s+|$)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.type.function.jade"
|
||||
}
|
||||
},
|
||||
"comment": "Jade control flow.",
|
||||
"end": "$",
|
||||
"name": "meta.control.flow.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "",
|
||||
"end": "$",
|
||||
"name": "js.embedded.control.flow.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"html_entity": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
|
||||
"name": "constant.character.entity.html.text.jade"
|
||||
},
|
||||
{
|
||||
"match": "[<>&]",
|
||||
"name": "invalid.illegal.html_entity.text.jade"
|
||||
}
|
||||
]
|
||||
},
|
||||
"inline_jade": {
|
||||
"begin": "(?<!\\\\)(#\\[)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.jade"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.function.jade"
|
||||
}
|
||||
},
|
||||
"end": "(\\])",
|
||||
"name": "inline.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline_jade"
|
||||
},
|
||||
{
|
||||
"include": "#mixin_call"
|
||||
},
|
||||
{
|
||||
"begin": "(?<!\\])(?=[\\w.#])|(:\\s*)",
|
||||
"end": "(?=\\]|(:.)|=|\\s)",
|
||||
"name": "tag.inline.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_name"
|
||||
},
|
||||
{
|
||||
"include": "#tag_id"
|
||||
},
|
||||
{
|
||||
"include": "#tag_classes"
|
||||
},
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
},
|
||||
{
|
||||
"include": "#tag_mixin_attributes"
|
||||
},
|
||||
{
|
||||
"include": "#inline_jade"
|
||||
},
|
||||
{
|
||||
"match": "\\[",
|
||||
"name": "invalid.illegal.tag.jade"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#unbuffered_code"
|
||||
},
|
||||
{
|
||||
"include": "#printed_expression"
|
||||
},
|
||||
{
|
||||
"match": "\\[",
|
||||
"name": "invalid.illegal.tag.jade"
|
||||
},
|
||||
{
|
||||
"include": "#inline_jade_text"
|
||||
}
|
||||
]
|
||||
},
|
||||
"inline_jade_text": {
|
||||
"begin": "",
|
||||
"end": "(?=\\])",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\[",
|
||||
"end": "\\]",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline_jade_text"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#inline_jade"
|
||||
},
|
||||
{
|
||||
"include": "#embedded_html"
|
||||
},
|
||||
{
|
||||
"include": "#html_entity"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_value"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_error"
|
||||
}
|
||||
]
|
||||
},
|
||||
"interpolated_error": {
|
||||
"match": "(?<!\\\\)[#!]\\{(?=[^}]*$)",
|
||||
"name": "invalid.illegal.tag.jade"
|
||||
},
|
||||
"interpolated_value": {
|
||||
"begin": "(?<!\\\\)[#!]\\{(?=.*?\\})",
|
||||
"end": "\\}",
|
||||
"name": "string.interpolated.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "{",
|
||||
"name": "invalid.illegal.tag.jade"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
"js_braces": {
|
||||
"begin": "\\{",
|
||||
"end": "\\}",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#js_braces"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
"js_brackets": {
|
||||
"begin": "\\[",
|
||||
"end": "\\]",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#js_brackets"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
"js_parens": {
|
||||
"begin": "\\(",
|
||||
"end": "\\)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#js_parens"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
"mixin_call": {
|
||||
"begin": "((?:mixin\\s+)|\\+)([\\w-]+)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.type.function.jade"
|
||||
},
|
||||
"2": {
|
||||
"name": "meta.tag.other entity.name.function.jade"
|
||||
}
|
||||
},
|
||||
"end": "(?!\\()|$",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(?<!\\))\\(",
|
||||
"end": "\\)",
|
||||
"name": "args.mixin.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#js_parens"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "meta.tag.other entity.other.attribute-name.tag.jade"
|
||||
}
|
||||
},
|
||||
"match": "([^\\s(),=/]+)\\s*=\\s*"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#tag_attributes"
|
||||
}
|
||||
]
|
||||
},
|
||||
"mixin_definition": {
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.type.function.jade"
|
||||
},
|
||||
"2": {
|
||||
"name": "meta.tag.other entity.name.function.jade"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.parameters.begin.js"
|
||||
},
|
||||
"4": {
|
||||
"name": "variable.parameter.function.js"
|
||||
},
|
||||
"5": {
|
||||
"name": "punctuation.definition.parameters.begin.js"
|
||||
}
|
||||
},
|
||||
"match": "(mixin\\s+)([\\w-]+)(?:(\\()\\s*((?:[a-zA-Z_]\\w*\\s*)(?:,\\s*[a-zA-Z_]\\w*\\s*)*)(\\)))?$"
|
||||
},
|
||||
"printed_expression": {
|
||||
"begin": "(!?\\=)\\s*",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "constant"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\])|$",
|
||||
"name": "source.js",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#js_brackets"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
"string": {
|
||||
"begin": "(['\"])",
|
||||
"end": "(?<!\\\\)\\1",
|
||||
"name": "string.quoted.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\((x[0-9a-fA-F]{2})|(u[0-9]{4})|.)",
|
||||
"name": "constant.character.quoted.jade"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_value"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_error"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tag_attribute_name": {
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.other.attribute-name.tag.jade"
|
||||
}
|
||||
},
|
||||
"match": "([^\\s(),=/!]+)\\s*"
|
||||
},
|
||||
"tag_attribute_name_paren": {
|
||||
"begin": "\\(\\s*",
|
||||
"end": "\\)",
|
||||
"name": "entity.other.attribute-name.tag.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_attribute_name_paren"
|
||||
},
|
||||
{
|
||||
"include": "#tag_attribute_name"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tag_attributes": {
|
||||
"begin": "(\\(\\s*)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "constant.name.attribute.tag.jade"
|
||||
}
|
||||
},
|
||||
"end": "(\\))",
|
||||
"name": "meta.tag.other",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#tag_attribute_name_paren"
|
||||
},
|
||||
{
|
||||
"include": "#tag_attribute_name"
|
||||
},
|
||||
{
|
||||
"match": "!(?!=)",
|
||||
"name": "invalid.illegal.tag.jade"
|
||||
},
|
||||
{
|
||||
"begin": "=\\s*",
|
||||
"end": "$|(?=,|(?:\\s+[^!%&*-+~|<>:?/])|\\))",
|
||||
"name": "attribute_value",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#js_parens"
|
||||
},
|
||||
{
|
||||
"include": "#js_brackets"
|
||||
},
|
||||
{
|
||||
"include": "#js_braces"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=[%&*-+~|<>:?/])\\s+",
|
||||
"end": "$|(?=,|(?:\\s+[^!%&*-+~|<>:?/])|\\))",
|
||||
"name": "attribute_value2",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#js_parens"
|
||||
},
|
||||
{
|
||||
"include": "#js_brackets"
|
||||
},
|
||||
{
|
||||
"include": "#js_braces"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tag_classes": {
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "invalid.illegal.tag.jade"
|
||||
}
|
||||
},
|
||||
"match": "\\.([^\\w-])?[\\w-]*",
|
||||
"name": "constant.language.js"
|
||||
},
|
||||
"tag_id": {
|
||||
"match": "#[\\w-]+",
|
||||
"name": "constant.id.tag.jade"
|
||||
},
|
||||
"tag_mixin_attributes": {
|
||||
"begin": "(&attributes\\()",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.jade"
|
||||
}
|
||||
},
|
||||
"end": "(\\))",
|
||||
"name": "meta.tag.other",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "attributes(?=\\))",
|
||||
"name": "storage.type.keyword.jade"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tag_name": {
|
||||
"begin": "([#!]\\{(?=.*?\\}))|(\\w(([\\w:-]+[\\w-])|([\\w-]*)))",
|
||||
"end": "(\\G(?<!\\5[^\\w-]))|\\}|$",
|
||||
"name": "meta.tag.other entity.name.tag.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G(?<=\\{)",
|
||||
"end": "(?=\\})",
|
||||
"name": "meta.tag.other entity.name.tag.jade",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "{",
|
||||
"name": "invalid.illegal.tag.jade"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tag_text": {
|
||||
"begin": "(?=.)",
|
||||
"end": "$",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline_jade"
|
||||
},
|
||||
{
|
||||
"include": "#embedded_html"
|
||||
},
|
||||
{
|
||||
"include": "#html_entity"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_value"
|
||||
},
|
||||
{
|
||||
"include": "#interpolated_error"
|
||||
}
|
||||
]
|
||||
},
|
||||
"unbuffered_code": {
|
||||
"begin": "(-|(([a-zA-Z0-9_]+)\\s+=))",
|
||||
"beginCaptures": {
|
||||
"3": {
|
||||
"name": "variable.parameter.javascript.embedded.jade"
|
||||
}
|
||||
},
|
||||
"comment": "name = function() {}",
|
||||
"end": "(?=\\])|$",
|
||||
"name": "source.js",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#js_brackets"
|
||||
},
|
||||
{
|
||||
"include": "source.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scopeName": "text.jade",
|
||||
"uuid": "eee6ba25-6ac2-4f7e-9c70-cddf2bd3448b",
|
||||
"version": "https://github.com/davidrios/jade-tmbundle/commit/7c1304aa5a0d916a93fd296d3dd994219ecdc90f"
|
||||
}
|
||||
3575
extensions/vscode/textmate-syntaxes/JavaScript.tmLanguage.json
Normal file
3575
extensions/vscode/textmate-syntaxes/JavaScript.tmLanguage.json
Normal file
File diff suppressed because one or more lines are too long
3438
extensions/vscode/textmate-syntaxes/MagicPython.tmLanguage.json
Normal file
3438
extensions/vscode/textmate-syntaxes/MagicPython.tmLanguage.json
Normal file
File diff suppressed because it is too large
Load diff
435
extensions/vscode/textmate-syntaxes/MagicRegExp.tmLanguage.json
Normal file
435
extensions/vscode/textmate-syntaxes/MagicRegExp.tmLanguage.json
Normal file
|
|
@ -0,0 +1,435 @@
|
|||
{
|
||||
"name": "MagicRegExp",
|
||||
"scopeName": "source.regexp.python",
|
||||
"fileTypes": [
|
||||
"re"
|
||||
],
|
||||
"uuid": "39e15186-71e6-11e5-b82c-7c6d62900c7c",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"regexp-base-expression": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.other.match.any.regexp",
|
||||
"match": "\\."
|
||||
},
|
||||
{
|
||||
"name": "support.other.match.begin.regexp",
|
||||
"match": "\\^"
|
||||
},
|
||||
{
|
||||
"name": "support.other.match.end.regexp",
|
||||
"match": "\\$"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.quantifier.regexp",
|
||||
"match": "[+*?]\\??"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.disjunction.regexp",
|
||||
"match": "\\|"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.quantifier.regexp",
|
||||
"match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-sequence"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-backreference-number": {
|
||||
"name": "meta.backreference.regexp",
|
||||
"match": "(\\\\[1-9]\\d?)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.tag.backreference.regexp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"regexp-backreference": {
|
||||
"name": "meta.backreference.named.regexp",
|
||||
"match": "(?x)\n (\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.backreference.named.begin.regexp support.other.parenthesis.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.named.backreference.regexp"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.parenthesis.backreference.named.end.regexp support.other.parenthesis.regexp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"regexp-flags": {
|
||||
"name": "storage.modifier.flag.regexp",
|
||||
"match": "\\(\\?[aiLmsux]+\\)"
|
||||
},
|
||||
"regexp-escape-special": {
|
||||
"name": "support.other.escape.special.regexp",
|
||||
"match": "\\\\([AbBdDsSwWZ])"
|
||||
},
|
||||
"regexp-escape-character": {
|
||||
"name": "constant.character.escape.regexp",
|
||||
"match": "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | 0[0-7]{1,2}\n | [0-7]{3}\n )\n"
|
||||
},
|
||||
"regexp-escape-unicode": {
|
||||
"name": "constant.character.unicode.regexp",
|
||||
"match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n )\n"
|
||||
},
|
||||
"regexp-escape-catchall": {
|
||||
"name": "constant.character.escape.regexp",
|
||||
"match": "\\\\(.|\\n)"
|
||||
},
|
||||
"regexp-escape-sequence": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-escape-special"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-character"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-unicode"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-backreference-number"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-catchall"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-charecter-set-escapes": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.regexp",
|
||||
"match": "\\\\[abfnrtv\\\\]"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-special"
|
||||
},
|
||||
{
|
||||
"name": "constant.character.escape.regexp",
|
||||
"match": "\\\\([0-7]{1,3})"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-character"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-unicode"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-escape-catchall"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-expression": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-base-expression"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-character-set"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-comments"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-flags"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-named-group"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-backreference"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-lookahead"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-lookahead-negative"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-lookbehind"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-lookbehind-negative"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-conditional"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-parentheses-non-capturing"
|
||||
},
|
||||
{
|
||||
"include": "#regexp-parentheses"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-character-set": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
|
||||
},
|
||||
{
|
||||
"name": "meta.character.set.regexp",
|
||||
"begin": "(\\[)(\\^)?(\\])?",
|
||||
"end": "(\\])",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.operator.negation.regexp"
|
||||
},
|
||||
"3": {
|
||||
"name": "constant.character.set.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "constant.other.set.regexp punctuation.character.set.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-charecter-set-escapes"
|
||||
},
|
||||
{
|
||||
"name": "constant.character.set.regexp",
|
||||
"match": "[^\\n]"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-named-group": {
|
||||
"name": "meta.named.regexp",
|
||||
"begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.tag.named.group.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-comments": {
|
||||
"name": "comment.regexp",
|
||||
"begin": "\\(\\?#",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.comment.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.comment.end.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#codetags"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-lookahead": {
|
||||
"begin": "(\\()\\?=",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.lookahead.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookahead.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-lookahead-negative": {
|
||||
"begin": "(\\()\\?!",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.lookahead.negative.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookahead.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-lookbehind": {
|
||||
"begin": "(\\()\\?<=",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.lookbehind.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookbehind.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-lookbehind-negative": {
|
||||
"begin": "(\\()\\?<!",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.lookbehind.negative.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookbehind.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-conditional": {
|
||||
"begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.operator.conditional.regexp"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.conditional.begin.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-parentheses-non-capturing": {
|
||||
"begin": "\\(\\?:",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp-parentheses": {
|
||||
"begin": "\\(",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.newline.python"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp-expression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "https://github.com/MagicStack/MagicPython/commit/a45287d159f82256c768ad2e1114ca9751d28670"
|
||||
}
|
||||
475
extensions/vscode/textmate-syntaxes/Makefile.json
Normal file
475
extensions/vscode/textmate-syntaxes/Makefile.json
Normal file
|
|
@ -0,0 +1,475 @@
|
|||
{
|
||||
"fileTypes": [
|
||||
"Makefile",
|
||||
"makefile",
|
||||
"GNUmakefile",
|
||||
"OCamlMakefile"
|
||||
],
|
||||
"name": "Makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#variable-assignment"
|
||||
},
|
||||
{
|
||||
"include": "#recipe"
|
||||
},
|
||||
{
|
||||
"include": "#directives"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"comment": {
|
||||
"begin": "(^[ \\t]+)?(?=#)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.leading.makefile"
|
||||
}
|
||||
},
|
||||
"end": "(?!\\G)",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "#",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.makefile"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"name": "comment.line.number-sign.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\\\n",
|
||||
"name": "constant.character.escape.continuation.makefile"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"directives": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "^[ ]*([s\\-]?include)\\b",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.include.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"match": "%",
|
||||
"name": "constant.other.placeholder.makefile"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^[ ]*(vpath)\\b",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.vpath.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"match": "%",
|
||||
"name": "constant.other.placeholder.makefile"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(?:(override)\\s*)?(define)\\s*([^\\s]+)\\s*(=|\\?=|:=|\\+=)?(?=\\s)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.override.makefile"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.control.define.makefile"
|
||||
},
|
||||
"3": {
|
||||
"name": "variable.other.makefile"
|
||||
},
|
||||
"4": {
|
||||
"name": "punctuation.separator.key-value.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^(endef)\\b",
|
||||
"name": "meta.scope.conditional.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G(?!\\n)",
|
||||
"end": "^",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^[ ]*(export)\\b",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.$1.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#variable-assignment"
|
||||
},
|
||||
{
|
||||
"match": "[^\\s]+",
|
||||
"name": "variable.other.makefile"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^[ ]*(override|private)\\b",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.$1.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#variable-assignment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^[ ]*(unexport|undefine)\\b",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.$1.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"match": "[^\\s]+",
|
||||
"name": "variable.other.makefile"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(ifdef|ifndef)\\s*([^\\s]+)(?=\\s)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.$1.makefile"
|
||||
},
|
||||
"2": {
|
||||
"name": "variable.other.makefile"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.separator.key-value.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^(endif)\\b",
|
||||
"name": "meta.scope.conditional.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G(?!\\n)",
|
||||
"end": "^",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^(ifeq|ifneq)(?=\\s)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.$1.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^(endif)\\b",
|
||||
"name": "meta.scope.conditional.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G",
|
||||
"end": "^",
|
||||
"name": "meta.scope.condition.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^else(?=\\s)",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "keyword.control.else.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^"
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"interpolation": {
|
||||
"begin": "(?=`)",
|
||||
"end": "(?!\\G)",
|
||||
"name": "meta.embedded.line.shell",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "`",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.makefile"
|
||||
}
|
||||
},
|
||||
"contentName": "source.shell",
|
||||
"end": "(`)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.makefile"
|
||||
},
|
||||
"1": {
|
||||
"name": "source.shell"
|
||||
}
|
||||
},
|
||||
"name": "string.interpolated.backtick.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.shell"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"recipe": {
|
||||
"begin": "^(?!\\t)([^:]*)(:)(?!\\=)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "support.function.target.$1.makefile"
|
||||
}
|
||||
},
|
||||
"match": "^\\s*(\\.(PHONY|SUFFIXES|DEFAULT|PRECIOUS|INTERMEDIATE|SECONDARY|SECONDEXPANSION|DELETE_ON_ERROR|IGNORE|LOW_RESOLUTION_TIME|SILENT|EXPORT_ALL_VARIABLES|NOTPARALLEL|ONESHELL|POSIX))\\s*$"
|
||||
},
|
||||
{
|
||||
"begin": "(?=\\S)",
|
||||
"end": "(?=\\s|$)",
|
||||
"name": "entity.name.function.target.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"match": "%",
|
||||
"name": "constant.other.placeholder.makefile"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.separator.key-value.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^(?!\\t)",
|
||||
"name": "meta.scope.target.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G",
|
||||
"end": "^",
|
||||
"name": "meta.scope.prerequisites.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\\\n",
|
||||
"name": "constant.character.escape.continuation.makefile"
|
||||
},
|
||||
{
|
||||
"match": "%|\\*",
|
||||
"name": "constant.other.placeholder.makefile"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#variables"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "^\\t",
|
||||
"name": "meta.scope.recipe.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"0": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\\\n",
|
||||
"name": "constant.character.escape.continuation.makefile"
|
||||
},
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"include": "source.shell"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"match": ".+\\n?"
|
||||
}
|
||||
],
|
||||
"while": "^\\t"
|
||||
}
|
||||
]
|
||||
},
|
||||
"variable-assignment": {
|
||||
"begin": "(^[ ]*|\\G\\s*)([^\\s]+)\\s*(=|\\?=|:=|\\+=)",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "variable.other.makefile"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.separator.key-value.makefile"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\\\n",
|
||||
"name": "constant.character.escape.continuation.makefile"
|
||||
},
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"include": "#interpolation"
|
||||
}
|
||||
]
|
||||
},
|
||||
"variables": {
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.variable.makefile"
|
||||
}
|
||||
},
|
||||
"match": "(\\$?\\$)[@%<?^+*]",
|
||||
"name": "variable.language.makefile"
|
||||
},
|
||||
{
|
||||
"begin": "\\$?\\$\\(",
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.variable.makefile"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"name": "string.interpolated.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"match": "\\G(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
|
||||
"name": "variable.language.makefile"
|
||||
},
|
||||
{
|
||||
"begin": "\\G(subst|patsubst|strip|findstring|filter(-out)?|sort|word(list)?|firstword|lastword|dir|notdir|suffix|basename|addsuffix|addprefix|join|wildcard|realpath|abspath|info|error|warning|shell|foreach|if|or|and|call|eval|value|file|guile)\\s",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "support.function.$1.makefile"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\))",
|
||||
"name": "meta.scope.function-call.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"match": "%|\\*",
|
||||
"name": "constant.other.placeholder.makefile"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\G(origin|flavor)\\s(?=[^\\s)]+\\s*\\))",
|
||||
"contentName": "variable.other.makefile",
|
||||
"end": "(?=\\))",
|
||||
"name": "meta.scope.function-call.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variables"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\G(?!\\))",
|
||||
"end": "(?=\\))",
|
||||
"name": "variable.other.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variables"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scopeName": "source.makefile",
|
||||
"uuid": "FF1825E8-6B1C-11D9-B883-000D93589AF6",
|
||||
"version": "https://github.com/textmate/make.tmbundle/commit/1a1827da81e20fdce56e2658451340c070ca44b7"
|
||||
}
|
||||
1432
extensions/vscode/textmate-syntaxes/Objective-C.tmLanguage
Normal file
1432
extensions/vscode/textmate-syntaxes/Objective-C.tmLanguage
Normal file
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue