Modified Pyright so its highlighting is closer to Viper
Some checks are pending
Run mypy_primer on push / Run mypy_primer on push (push) Waiting to run
Validation / Typecheck (push) Waiting to run
Validation / Style (push) Waiting to run
Validation / Test macos-latest (push) Blocked by required conditions
Validation / Test ubuntu-latest (push) Blocked by required conditions
Validation / Test windows-latest (push) Blocked by required conditions
Validation / Build (push) Blocked by required conditions
Validation / Required (push) Blocked by required conditions

This commit is contained in:
2026-07-28 02:56:01 +08:00
parent e9e4693333
commit e126548249
7540 changed files with 26537 additions and 994 deletions

View File

@@ -1,20 +0,0 @@
/* eslint-disable @typescript-eslint/no-var-requires */
//@ts-check
const { promises: fsAsync } = require('fs');
const chalk = require('chalk').default;
async function main() {
const packageJson = await fsAsync.readFile('package.json', 'utf-8');
const obj = JSON.parse(packageJson);
const name = obj.name;
if (name !== 'pyright') {
console.error(chalk.red(`Extension name must be "pyright", but is currently set to "${name}".`));
console.error(chalk.red('Please package by running "npm run package" to ensure the name is set correctly.'));
console.error();
process.exit(1);
}
}
main();

View File

@@ -1,37 +0,0 @@
/* eslint-disable @typescript-eslint/no-var-requires */
//@ts-check
const { promises: fsAsync } = require('fs');
/**
* @param {string} filepath
* @param {(obj: any) => void} modifier
*/
async function modifyJsonInPlace(filepath, modifier) {
const input = await fsAsync.readFile(filepath, 'utf-8');
const obj = JSON.parse(input);
modifier(obj);
// Always 4 spaces for indent.
let output = JSON.stringify(obj, null, 4);
if (input.endsWith('\n')) {
output += '\n';
}
if (input.indexOf('\r\n') !== -1) {
output = output.replace(/\n/g, '\r\n');
}
await fsAsync.writeFile(filepath, output, 'utf-8');
}
async function main() {
const name = process.argv[2];
await modifyJsonInPlace('package.json', (obj) => {
obj.name = name;
});
}
main();