linguist-js 2.7.0-pre → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -8,6 +8,7 @@ const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const commander_1 = require("commander");
10
10
  const index_1 = __importDefault(require("./index"));
11
+ const norm_path_1 = require("./helpers/norm-path");
11
12
  const colouredMsg = ([r, g, b], msg) => `\u001B[${38};2;${r};${g};${b}m${msg}${'\u001b[0m'}`;
12
13
  const hexToRgb = (hex) => [parseInt(hex.slice(1, 3), 16), parseInt(hex.slice(3, 5), 16), parseInt(hex.slice(5, 7), 16)];
13
14
  commander_1.program
@@ -92,7 +93,7 @@ if (args.analyze)
92
93
  if (args.listFiles) {
93
94
  console.log(); // padding
94
95
  for (const file of filesPerLanguage[lang]) {
95
- let relFile = path_1.default.relative(path_1.default.resolve('.'), file).replace(/\\/g, '/');
96
+ let relFile = (0, norm_path_1.normPath)(path_1.default.relative(path_1.default.resolve('.'), file));
96
97
  if (!relFile.startsWith('../'))
97
98
  relFile = './' + relFile;
98
99
  const bytes = (await fs_1.default.promises.stat(file)).size;
@@ -0,0 +1,2 @@
1
+ export declare const normPath: (...inputPaths: string[]) => string;
2
+ export declare const normAbsPath: (...inputPaths: string[]) => string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.normAbsPath = exports.normPath = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const normPath = function normalisedPath(...inputPaths) {
9
+ return path_1.default.join(...inputPaths).replace(/\\/g, '/');
10
+ };
11
+ exports.normPath = normPath;
12
+ const normAbsPath = function normalisedAbsolutePath(...inputPaths) {
13
+ return path_1.default.resolve(...inputPaths).replace(/\\/g, '/');
14
+ };
15
+ exports.normAbsPath = normAbsPath;
@@ -1,21 +1,19 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const path_1 = __importDefault(require("path"));
3
+ const norm_path_1 = require("./norm-path");
7
4
  /**
8
5
  * Parses a gitattributes file.
9
6
  */
10
7
  function parseAttributes(content, folderRoot = '.') {
11
8
  var _a, _b;
12
9
  const output = [];
13
- for (const line of content.split('\n')) {
10
+ for (const rawLine of content.split('\n')) {
11
+ const line = rawLine.replace(/#.*/, '').trim();
14
12
  if (!line)
15
13
  continue;
16
14
  const parts = line.split(/\s+/g);
17
15
  const fileGlob = parts[0];
18
- const relFileGlob = path_1.default.join(folderRoot, fileGlob).replace(/\\/g, '/');
16
+ const relFileGlob = (0, norm_path_1.normPath)(folderRoot, fileGlob);
19
17
  const attrParts = parts.slice(1);
20
18
  const isTrue = (str) => !str.startsWith('-') && !str.endsWith('=false');
21
19
  const isFalse = (str) => str.startsWith('-') || str.endsWith('=false');
@@ -0,0 +1 @@
1
+ export default function parseGitignore(content: string): string[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function parseGitignore(content) {
4
+ const readableData = content
5
+ // Remove comments unless escaped
6
+ .replace(/(?<!\\)#.+/g, '')
7
+ // Remove whitespace unless escaped
8
+ .replace(/(?:(?<!\\)\s)+$/g, '');
9
+ const arrayData = readableData.split(/\r?\n/).filter(data => data);
10
+ return arrayData;
11
+ }
12
+ exports.default = parseGitignore;
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const fs_1 = __importDefault(require("fs"));
7
7
  const path_1 = __importDefault(require("path"));
8
+ const parse_gitignore_1 = __importDefault(require("./parse-gitignore"));
9
+ const norm_path_1 = require("./norm-path");
8
10
  let allFiles;
9
11
  let allFolders;
10
12
  ;
@@ -24,26 +26,38 @@ function walk(data) {
24
26
  // Get list of files and folders inside this folder
25
27
  const files = fs_1.default.readdirSync(folder).map(file => {
26
28
  // Create path relative to root
27
- const base = path_1.default.resolve(folder, file).replace(/\\/g, '/').replace(commonRoot, '.');
29
+ const base = (0, norm_path_1.normAbsPath)(folder, file).replace(commonRoot, '.');
28
30
  // Add trailing slash to mark directories
29
31
  const isDir = fs_1.default.lstatSync(path_1.default.resolve(commonRoot, base)).isDirectory();
30
32
  return isDir ? `${base}/` : base;
31
33
  });
34
+ // Read and apply gitignores
35
+ const gitignoreFilename = (0, norm_path_1.normPath)(folder, '.gitignore');
36
+ if (fs_1.default.existsSync(gitignoreFilename)) {
37
+ const gitignoreContents = fs_1.default.readFileSync(gitignoreFilename, 'utf-8');
38
+ const ignoredPaths = (0, parse_gitignore_1.default)(gitignoreContents);
39
+ ignored.add(ignoredPaths);
40
+ }
41
+ // Add gitattributes if present
42
+ const gitattributesPath = (0, norm_path_1.normPath)(folder, '.gitattributes');
43
+ if (fs_1.default.existsSync(gitattributesPath)) {
44
+ allFiles.add(gitattributesPath);
45
+ }
32
46
  // Loop through files and folders
33
47
  for (const file of files) {
34
48
  // Create absolute path for disc operations
35
- const path = path_1.default.resolve(commonRoot, file).replace(/\\/g, '/');
49
+ const path = (0, norm_path_1.normAbsPath)(commonRoot, file);
36
50
  const localPath = localRoot ? file.replace(`./${localRoot}/`, '') : file.replace('./', '');
37
51
  // Skip if nonexistant
38
52
  const nonExistant = !fs_1.default.existsSync(path);
39
53
  if (nonExistant)
40
54
  continue;
41
- // Skip if marked as ignored
55
+ // Skip if marked in gitignore
42
56
  const isIgnored = ignored.test(localPath).ignored;
43
57
  if (isIgnored)
44
58
  continue;
45
59
  // Add absolute folder path to list
46
- allFolders.add(path_1.default.resolve(folder).replace(/\\/g, '/'));
60
+ allFolders.add((0, norm_path_1.normAbsPath)(folder));
47
61
  // Check if this is a folder or file
48
62
  if (file.endsWith('/')) {
49
63
  // Recurse into subfolders
package/dist/index.js CHANGED
@@ -37,11 +37,12 @@ const load_data_1 = __importStar(require("./helpers/load-data"));
37
37
  const read_file_1 = __importDefault(require("./helpers/read-file"));
38
38
  const parse_gitattributes_1 = __importDefault(require("./helpers/parse-gitattributes"));
39
39
  const convert_pcre_1 = __importDefault(require("./helpers/convert-pcre"));
40
- async function analyse(rawInput, opts = {}) {
40
+ const norm_path_1 = require("./helpers/norm-path");
41
+ async function analyse(rawPaths, opts = {}) {
41
42
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
42
43
  var _r, _s;
43
44
  const useRawContent = opts.fileContent !== undefined;
44
- const input = [rawInput !== null && rawInput !== void 0 ? rawInput : []].flat();
45
+ const input = [rawPaths !== null && rawPaths !== void 0 ? rawPaths : []].flat();
45
46
  const manualFileContent = [(_a = opts.fileContent) !== null && _a !== void 0 ? _a : []].flat();
46
47
  // Normalise input option arguments
47
48
  opts = {
@@ -69,12 +70,10 @@ async function analyse(rawInput, opts = {}) {
69
70
  unknown: { count: 0, bytes: 0, extensions: {}, filenames: {} },
70
71
  };
71
72
  // Set a common root path so that vendor paths do not incorrectly match parent folders
72
- const normPath = (file) => file.replace(/\\/g, '/');
73
- const resolvedInput = input.map(path => normPath(path_1.default.resolve(path)));
73
+ const resolvedInput = input.map(path => (0, norm_path_1.normPath)(path_1.default.resolve(path)));
74
74
  const commonRoot = (input.length > 1 ? (0, common_path_prefix_1.default)(resolvedInput) : resolvedInput[0]).replace(/\/?$/, '');
75
- const localRoot = (folder) => folder.replace(commonRoot, '').replace(/^\//, '');
76
- const relPath = (file) => useRawContent ? file : normPath(path_1.default.relative(commonRoot, file));
77
- const unRelPath = (file) => useRawContent ? file : normPath(path_1.default.resolve(commonRoot, file));
75
+ const relPath = (file) => useRawContent ? file : (0, norm_path_1.normPath)(path_1.default.relative(commonRoot, file));
76
+ const unRelPath = (file) => useRawContent ? file : (0, norm_path_1.normPath)(path_1.default.resolve(commonRoot, file));
78
77
  // Other helper functions
79
78
  const fileMatchesGlobs = (file, ...globs) => (0, ignore_1.default)().add(globs).ignores(relPath(file));
80
79
  const filterOutIgnored = (files, ignored) => ignored.filter(files.map(relPath)).map(unRelPath);
@@ -83,42 +82,39 @@ async function analyse(rawInput, opts = {}) {
83
82
  const ignored = (0, ignore_1.default)();
84
83
  ignored.add('.git/');
85
84
  ignored.add((_b = opts.ignoredFiles) !== null && _b !== void 0 ? _b : []);
86
- const regexIgnores = [];
87
- if (!opts.keepVendored)
88
- regexIgnores.push(...vendorPaths.map(path => RegExp(path, 'i')));
85
+ const regexIgnores = opts.keepVendored ? [] : vendorPaths.map(path => RegExp(path, 'i'));
89
86
  // Load file paths and folders
90
87
  let files;
91
- let folders;
92
88
  if (useRawContent) {
93
89
  // Uses raw file content
94
90
  files = input;
95
- folders = [''];
96
91
  }
97
92
  else {
98
93
  // Uses directory on disc
99
94
  const data = (0, walk_tree_1.default)({ init: true, commonRoot, folderRoots: resolvedInput, folders: resolvedInput, ignored });
100
95
  files = data.files;
101
- folders = data.folders;
102
- }
103
- // Load gitignore data and apply ignores rules
104
- if (!useRawContent) {
105
- // TODO switch to be like the gitattributes code
106
- for (const folder of folders) {
107
- // Parse gitignores
108
- const ignoresFile = path_1.default.join(folder, '.gitignore');
109
- if (opts.checkIgnored && fs_1.default.existsSync(ignoresFile)) {
110
- const ignoresData = await (0, read_file_1.default)(ignoresFile);
111
- const localIgnoresData = ignoresData.replace(/^[\/\\]/g, localRoot(folder) + '/');
112
- ignored.add(localIgnoresData);
113
- files = filterOutIgnored(files, ignored);
114
- }
115
- }
116
96
  }
117
97
  // Fetch and normalise gitattributes data of all subfolders and save to metadata
118
98
  const manualAttributes = {}; // Maps file globs to gitattribute boolean flags
119
99
  const getFlaggedGlobs = (attr, val) => {
120
100
  return Object.entries(manualAttributes).filter(([, attrs]) => attrs[attr] === val).map(([glob,]) => glob);
121
101
  };
102
+ const findAttrsForPath = (filePath) => {
103
+ const resultAttrs = {};
104
+ for (const glob in manualAttributes) {
105
+ if ((0, ignore_1.default)().add(glob).ignores(relPath(filePath))) {
106
+ const matchingAttrs = manualAttributes[glob];
107
+ for (const [attr, val] of Object.entries(matchingAttrs)) {
108
+ if (val !== null)
109
+ resultAttrs[attr] = val;
110
+ }
111
+ }
112
+ }
113
+ if (!JSON.stringify(resultAttrs)) {
114
+ return null;
115
+ }
116
+ return resultAttrs;
117
+ };
122
118
  if (!useRawContent && opts.checkAttributes) {
123
119
  const nestedAttrFiles = files.filter(file => file.endsWith('.gitattributes'));
124
120
  for (const attrFile of nestedAttrFiles) {
@@ -131,22 +127,41 @@ async function analyse(rawInput, opts = {}) {
131
127
  }
132
128
  }
133
129
  }
130
+ // Remove files that are linguist-ignored via regex by default unless explicitly unignored in gitattributes
131
+ const filesToIgnore = [];
132
+ for (const file of files) {
133
+ const relFile = relPath(file);
134
+ const isRegexIgnored = regexIgnores.some(pattern => pattern.test(relFile));
135
+ if (!isRegexIgnored) {
136
+ // Checking overrides is moot if file is not even marked as ignored by default
137
+ continue;
138
+ }
139
+ const fileAttrs = findAttrsForPath(file);
140
+ if ((fileAttrs === null || fileAttrs === void 0 ? void 0 : fileAttrs.generated) === false || (fileAttrs === null || fileAttrs === void 0 ? void 0 : fileAttrs.vendored) === false) {
141
+ // File is explicitly marked as *not* to be ignored
142
+ // do nothing
143
+ }
144
+ else {
145
+ filesToIgnore.push(file);
146
+ }
147
+ }
148
+ files = files.filter(file => !filesToIgnore.includes(file));
134
149
  // Apply vendor file path matches and filter out vendored files
135
150
  if (!opts.keepVendored) {
136
151
  // Get data of files that have been manually marked with metadata
137
152
  const vendorTrueGlobs = [...getFlaggedGlobs('vendored', true), ...getFlaggedGlobs('generated', true), ...getFlaggedGlobs('documentation', true)];
138
153
  const vendorFalseGlobs = [...getFlaggedGlobs('vendored', false), ...getFlaggedGlobs('generated', false), ...getFlaggedGlobs('documentation', false)];
139
154
  // Set up glob ignore object to use for expanding globs to match files
140
- const vendorOverrides = (0, ignore_1.default)().add(vendorFalseGlobs);
155
+ const vendorTrueIgnore = (0, ignore_1.default)().add(vendorTrueGlobs);
156
+ const vendorFalseIgnore = (0, ignore_1.default)().add(vendorFalseGlobs);
141
157
  // Remove all files marked as vendored by default
142
158
  const excludedFiles = files.filter(file => vendorPaths.some(pathPtn => RegExp(pathPtn, 'i').test(relPath(file))));
143
159
  files = files.filter(file => !excludedFiles.includes(file));
144
160
  // Re-add removed files that are overridden manually in gitattributes
145
- const overriddenExcludedFiles = excludedFiles.filter(file => vendorOverrides.ignores(relPath(file)));
161
+ const overriddenExcludedFiles = excludedFiles.filter(file => vendorFalseIgnore.ignores(relPath(file)));
146
162
  files.push(...overriddenExcludedFiles);
147
163
  // Remove files explicitly marked as vendored in gitattributes
148
- // TODO change globs.includes(file) to parse the glob using ignore()
149
- files = files.filter(file => !vendorTrueGlobs.includes(relPath(file)));
164
+ files = files.filter(file => !vendorTrueIgnore.ignores(relPath(file)));
150
165
  }
151
166
  // Filter out binary files
152
167
  if (!opts.keepBinary) {
@@ -157,7 +172,6 @@ async function analyse(rawInput, opts = {}) {
157
172
  files = filterOutIgnored(files, binaryIgnored);
158
173
  // Re-add files manually marked not as binary
159
174
  const binaryUnignored = (0, ignore_1.default)().add(getFlaggedGlobs('binary', false));
160
- // TODO parse the globs using ignore()
161
175
  const unignoredList = filterOutIgnored(files, binaryUnignored);
162
176
  files.push(...unignoredList);
163
177
  }
@@ -386,7 +400,7 @@ async function analyse(rawInput, opts = {}) {
386
400
  if (!useRawContent && opts.relativePaths) {
387
401
  const newMap = {};
388
402
  for (const [file, lang] of Object.entries(results.files.results)) {
389
- let relPath = path_1.default.relative(process.cwd(), file).replace(/\\/g, '/');
403
+ let relPath = (0, norm_path_1.normPath)(path_1.default.relative(process.cwd(), file));
390
404
  if (!relPath.startsWith('../')) {
391
405
  relPath = './' + relPath;
392
406
  }
package/ext/generated.rb CHANGED
@@ -11,6 +11,7 @@
11
11
  - (^|\/)(\w+\.)?esy.lock$
12
12
  - npm-shrinkwrap\.json
13
13
  - package-lock\.json
14
+ - pnpm-lock\.yaml
14
15
  - (^|\/)\.pnp\..*$
15
16
  - Godeps\/
16
17
  - composer\.lock
@@ -22,3 +23,5 @@
22
23
  - ppport\.h$
23
24
  - __generated__\/
24
25
  - _tlb\.pas$
26
+ - (?:^|\/)htmlcov\/
27
+ - (?:^|.*\/)\.sqlx\/query-.+\.json$
@@ -45,7 +45,7 @@ disambiguations:
45
45
  - language: Public Key
46
46
  pattern: '^(----[- ]BEGIN|ssh-(rsa|dss)) '
47
47
  - language: AsciiDoc
48
- pattern: '^[=-]+(\s|\n)|\{\{[A-Za-z]'
48
+ pattern: '^[=-]+\s|\{\{[A-Za-z]'
49
49
  - language: AGS Script
50
50
  pattern: '^(\/\/.+|((import|export)\s+)?(function|int|float|char)\s+((room|repeatedly|on|game)_)?([A-Za-z]+[A-Za-z_0-9]+)\s*[;\(])'
51
51
  - extensions: ['.asm']
@@ -74,7 +74,7 @@ disambiguations:
74
74
  - language: BlitzBasic
75
75
  pattern: '(<^\s*; |End Function)'
76
76
  - language: BitBake
77
- pattern: '^\s*(# |include|require)\b'
77
+ pattern: '^(# |include|require|inherit)\b'
78
78
  - language: Clojure
79
79
  pattern: '\((def|defn|defmacro|let)\s'
80
80
  - extensions: ['.bf']
@@ -101,6 +101,8 @@ disambiguations:
101
101
  - (?i:^\s*(end\ssub)$)
102
102
  - (?i:^\s*(?=^function\s)(?:function\s*\w+\(.*?\)\s*as\s*\w*)|(?::\s*function\(.*?\)\s*as\s*\w*)$)
103
103
  - (?i:^\s*(end\sfunction)$)
104
+ - language: Bluespec BH
105
+ pattern: '^package\s+[A-Za-z_][A-Za-z0-9_'']*(?:\s*\(|\s+where)'
104
106
  - extensions: ['.builds']
105
107
  rules:
106
108
  - language: XML
@@ -132,7 +134,7 @@ disambiguations:
132
134
  - extensions: ['.cmp']
133
135
  rules:
134
136
  - language: Gerber Image
135
- pattern: '^[DGMT][0-9]{2}\*\r?\n'
137
+ pattern: '^[DGMT][0-9]{2}\*(?:\r?\n|\r)'
136
138
  - extensions: ['.cs']
137
139
  rules:
138
140
  - language: Smalltalk
@@ -242,7 +244,7 @@ disambiguations:
242
244
  - extensions: ['.ftl']
243
245
  rules:
244
246
  - language: FreeMarker
245
- pattern: '^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\$\{\w+[^\n]*?\}|^[ \t]*(?:<#--.*?-->|<#([a-z]+)(?=\s|>)[^>]*>.*?</#\1>|\[#--.*?--\]|\[#([a-z]+)(?=\s|\])[^\]]*\].*?\[#\2\])'
247
+ pattern: '^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\$\{\w+[^\r\n]*?\}|^[ \t]*(?:<#--.*?-->|<#([a-z]+)(?=\s|>)[^>]*>.*?</#\1>|\[#--.*?--\]|\[#([a-z]+)(?=\s|\])[^\]]*\].*?\[#\2\])'
246
248
  - language: Fluent
247
249
  pattern: '^-?[a-zA-Z][a-zA-Z0-9_-]* *=|\{\$-?[a-zA-Z][-\w]*(?:\.[a-zA-Z][-\w]*)?\}'
248
250
  - extensions: ['.g']
@@ -250,7 +252,7 @@ disambiguations:
250
252
  - language: GAP
251
253
  pattern: '\s*(Declare|BindGlobal|KeyDependentOperation|Install(Method|GlobalFunction)|SetPackageInfo)'
252
254
  - language: G-code
253
- pattern: '^[MG][0-9]+\n'
255
+ pattern: '^[MG][0-9]+(?:\r?\n|\r)'
254
256
  - extensions: ['.gd']
255
257
  rules:
256
258
  - language: GAP
@@ -282,6 +284,12 @@ disambiguations:
282
284
  rules:
283
285
  - language: GSC
284
286
  named_pattern: gsc
287
+ - extensions: ['.gts']
288
+ rules:
289
+ - language: Gerber Image
290
+ pattern: '^G0.'
291
+ - language: Glimmer TS
292
+ negative_pattern: '^G0.'
285
293
  - extensions: ['.h']
286
294
  rules:
287
295
  - language: Objective-C
@@ -333,6 +341,8 @@ disambiguations:
333
341
  pattern:
334
342
  - '(?i:^\s*\{\$(?:mode|ifdef|undef|define)[ ]+[a-z0-9_]+\})'
335
343
  - '^\s*end[.;]\s*$'
344
+ - language: BitBake
345
+ pattern: '^inherit(\s+[\w.-]+)+\s*$'
336
346
  - extensions: ['.json']
337
347
  rules:
338
348
  - language: OASv2-json
@@ -350,6 +360,12 @@ disambiguations:
350
360
  pattern: '^\.[A-Za-z]{2}(\s|$)'
351
361
  - language: PicoLisp
352
362
  pattern: '^\((de|class|rel|code|data|must)\s'
363
+ - extensions: ['.lean']
364
+ rules:
365
+ - language: Lean
366
+ pattern: '^import [a-z]'
367
+ - language: Lean 4
368
+ pattern: '^import [A-Z]'
353
369
  - extensions: ['.ls']
354
370
  rules:
355
371
  - language: LoomScript
@@ -395,7 +411,7 @@ disambiguations:
395
411
  - language: Win32 Message File
396
412
  pattern: '(?i)^[ \t]*(?>\/\*\s*)?MessageId=|^\.$'
397
413
  - language: M4
398
- pattern: '^dnl|^divert\((?:-?\d+)?\)|^\w+\(`[^\n]*?''[),]'
414
+ pattern: '^dnl|^divert\((?:-?\d+)?\)|^\w+\(`[^\r\n]*?''[),]'
399
415
  - language: Monkey C
400
416
  pattern: '\b(?:using|module|function|class|var)\s+\w'
401
417
  - extensions: ['.md']
@@ -420,6 +436,12 @@ disambiguations:
420
436
  - language: Modula-2
421
437
  pattern: '^\s*(?i:MODULE|END) [\w\.]+;'
422
438
  - language: [Linux Kernel Module, AMPL]
439
+ - extensions: ['.mojo']
440
+ rules:
441
+ - language: Mojo
442
+ pattern: '^\s*(alias|def|from|fn|import|struct|trait)\s'
443
+ - language: XML
444
+ pattern: '^\s*<\?xml'
423
445
  - extensions: ['.ms']
424
446
  rules:
425
447
  - language: Roff
@@ -440,7 +462,7 @@ disambiguations:
440
462
  - language: XML
441
463
  pattern: '^\s*<\?xml\s+version'
442
464
  - language: Gerber Image
443
- pattern: '^[DGMT][0-9]{2}\*\r?\n'
465
+ pattern: '^[DGMT][0-9]{2}\*(?:\r?\n|\r)'
444
466
  - language: Text
445
467
  pattern: 'THE_TITLE'
446
468
  - extensions: ['.nl']
@@ -504,7 +526,7 @@ disambiguations:
504
526
  - extensions: ['.pod']
505
527
  rules:
506
528
  - language: Pod 6
507
- pattern: '^[\s&&[^\n]]*=(comment|begin pod|begin para|item\d+)'
529
+ pattern: '^[\s&&[^\r\n]]*=(comment|begin pod|begin para|item\d+)'
508
530
  - language: Pod
509
531
  - extensions: ['.pp']
510
532
  rules:
@@ -543,7 +565,7 @@ disambiguations:
543
565
  - extensions: ['.q']
544
566
  rules:
545
567
  - language: q
546
- pattern: '((?i:[A-Z.][\w.]*:\{)|(^|\n)\\(cd?|d|l|p|ts?) )'
568
+ pattern: '((?i:[A-Z.][\w.]*:\{)|^\\(cd?|d|l|p|ts?) )'
547
569
  - language: HiveQL
548
570
  pattern: '(?i:SELECT\s+[\w*,]+\s+FROM|(CREATE|ALTER|DROP)\s(DATABASE|SCHEMA|TABLE))'
549
571
  - extensions: ['.qs']
@@ -556,6 +578,8 @@ disambiguations:
556
578
  rules:
557
579
  - language: Rebol
558
580
  pattern: '(?i:\bRebol\b)'
581
+ - language: Rez
582
+ pattern: '(#include\s+["<](Types\.r|Carbon\/Carbon\.r)[">])|((resource|data|type)\s+''[A-Za-z0-9]{4}''\s+((\(.*\)\s+){0,1}){)'
559
583
  - language: R
560
584
  pattern: '<-|^\s*#'
561
585
  - extensions: ['.re']
@@ -615,7 +639,7 @@ disambiguations:
615
639
  - language: Solidity
616
640
  pattern: '\bpragma\s+solidity\b|\b(?:abstract\s+)?contract\s+(?!\d)[a-zA-Z0-9$_]+(?:\s+is\s+(?:[a-zA-Z0-9$_][^\{]*?)?)?\s*\{'
617
641
  - language: Gerber Image
618
- pattern: '^[DGMT][0-9]{2}\*\r?\n'
642
+ pattern: '^[DGMT][0-9]{2}\*(?:\r?\n|\r)'
619
643
  - extensions: ['.sql']
620
644
  rules:
621
645
  - language: PLpgSQL
@@ -645,7 +669,7 @@ disambiguations:
645
669
  - extensions: ['.stl']
646
670
  rules:
647
671
  - language: STL
648
- pattern: '\A\s*solid(?=$|\s)(?:.|[\r\n])*?^endsolid(?:$|\s)'
672
+ pattern: '\A\s*solid(?:$|\s)[\s\S]*^endsolid(?:$|\s)'
649
673
  - extensions: ['.sw']
650
674
  rules:
651
675
  - language: Sway
@@ -699,10 +723,15 @@ disambiguations:
699
723
  - language: Adblock Filter List
700
724
  pattern: '\A\[(?<version>(?:[Aa]d[Bb]lock(?:[ \t][Pp]lus)?|u[Bb]lock(?:[ \t][Oo]rigin)?|[Aa]d[Gg]uard)(?:[ \t] \d+(?:\.\d+)*+)?)(?:[ \t]?;[ \t]?\g<version>)*+\]'
701
725
  - language: Text
726
+ - extensions: ['.typ']
727
+ rules:
728
+ - language: Typst
729
+ pattern: '^#(import|show|let|set)'
730
+ - language: XML
702
731
  - extensions: ['.url']
703
732
  rules:
704
733
  - language: INI
705
- pattern: '^\[InternetShortcut\](?:\r?\n|\r)(?>[^\s\[][^\n]*(?:\r?\n|\r))*URL='
734
+ pattern: '^\[InternetShortcut\](?:\r?\n|\r)(?>[^\s\[][^\r\n]*(?:\r?\n|\r))*URL='
706
735
  - extensions: ['.v']
707
736
  rules:
708
737
  - language: Coq
@@ -755,6 +784,7 @@ named_patterns:
755
784
  - '^[ \t]*catch\s*\('
756
785
  - '^[ \t]*(class|(using[ \t]+)?namespace)\s+\w+'
757
786
  - '^[ \t]*(private|public|protected):$'
787
+ - '__has_cpp_attribute|__cplusplus >'
758
788
  - 'std::\w+'
759
789
  euphoria:
760
790
  - '^\s*namespace\s'
@@ -796,7 +826,7 @@ named_patterns:
796
826
  - '^[ ]*(?:Public|Private)? Declare PtrSafe (?:Sub|Function)\b'
797
827
  - '^[ ]*#If Win64\b'
798
828
  - '^[ ]*(?:Dim|Const) [0-9a-zA-Z_]*[ ]*As Long(?:Ptr|Long)\b'
799
- - '^[ ]*Option (?:Private Module|Compare Database)\b'
829
+ - '^[ ]*Option (?:Private Module|Compare (?:Database|Text|Binary))\b'
800
830
  - '(?: |\()(?:Access|Excel|Outlook|PowerPoint|Visio|Word|VBIDE)\.\w'
801
831
  - '\b(?:(?:Active)?VBProjects?|VBComponents?|Application\.(?:VBE|ScreenUpdating))\b'
802
832
  - '\b(?:ThisDrawing|AcadObject|Active(?:Explorer|Inspector|Window\.Presentation|Presentation|Document)|Selection\.(?:Find|Paragraphs))\b'
package/ext/languages.yml CHANGED
@@ -538,6 +538,7 @@ Bicep:
538
538
  color: "#519aba"
539
539
  extensions:
540
540
  - ".bicep"
541
+ - ".bicepparam"
541
542
  tm_scope: source.bicep
542
543
  ace_mode: text
543
544
  language_id: 321200902
@@ -563,9 +564,12 @@ Bison:
563
564
  BitBake:
564
565
  type: programming
565
566
  color: "#00bce4"
566
- tm_scope: none
567
+ tm_scope: source.bb
567
568
  extensions:
568
569
  - ".bb"
570
+ - ".bbappend"
571
+ - ".bbclass"
572
+ - ".inc"
569
573
  ace_mode: text
570
574
  language_id: 32
571
575
  Blade:
@@ -606,9 +610,28 @@ Bluespec:
606
610
  color: "#12223c"
607
611
  extensions:
608
612
  - ".bsv"
613
+ aliases:
614
+ - bluespec bsv
615
+ - bsv
609
616
  tm_scope: source.bsv
610
617
  ace_mode: verilog
618
+ codemirror_mode: verilog
619
+ codemirror_mime_type: text/x-systemverilog
611
620
  language_id: 36
621
+ Bluespec BH:
622
+ type: programming
623
+ group: Bluespec
624
+ color: "#12223c"
625
+ extensions:
626
+ - ".bs"
627
+ aliases:
628
+ - bh
629
+ - bluespec classic
630
+ tm_scope: source.bh
631
+ ace_mode: haskell
632
+ codemirror_mode: haskell
633
+ codemirror_mime_type: text/x-haskell
634
+ language_id: 641580358
612
635
  Boo:
613
636
  type: programming
614
637
  color: "#d4bec1"
@@ -692,6 +715,7 @@ C#:
692
715
  extensions:
693
716
  - ".cs"
694
717
  - ".cake"
718
+ - ".cs.pp"
695
719
  - ".csx"
696
720
  - ".linq"
697
721
  language_id: 42
@@ -1157,7 +1181,7 @@ ColdFusion CFC:
1157
1181
  language_id: 65
1158
1182
  Common Lisp:
1159
1183
  type: programming
1160
- tm_scope: source.lisp
1184
+ tm_scope: source.commonlisp
1161
1185
  color: "#3fb68b"
1162
1186
  aliases:
1163
1187
  - lisp
@@ -1540,6 +1564,7 @@ Dotenv:
1540
1564
  - ".env.local"
1541
1565
  - ".env.prod"
1542
1566
  - ".env.production"
1567
+ - ".env.sample"
1543
1568
  - ".env.staging"
1544
1569
  - ".env.test"
1545
1570
  - ".env.testing"
@@ -1607,7 +1632,7 @@ ECL:
1607
1632
  ECLiPSe:
1608
1633
  type: programming
1609
1634
  color: "#001d9d"
1610
- group: prolog
1635
+ group: Prolog
1611
1636
  extensions:
1612
1637
  - ".ecl"
1613
1638
  tm_scope: source.prolog.eclipse
@@ -1689,6 +1714,25 @@ Ecmarkup:
1689
1714
  aliases:
1690
1715
  - ecmarkdown
1691
1716
  language_id: 844766630
1717
+ Edge:
1718
+ type: markup
1719
+ color: "#0dffe0"
1720
+ extensions:
1721
+ - ".edge"
1722
+ tm_scope: text.html.edge
1723
+ ace_mode: html
1724
+ language_id: 460509620
1725
+ EdgeQL:
1726
+ type: programming
1727
+ color: "#31A7FF"
1728
+ aliases:
1729
+ - esdl
1730
+ extensions:
1731
+ - ".edgeql"
1732
+ - ".esdl"
1733
+ ace_mode: text
1734
+ tm_scope: source.edgeql
1735
+ language_id: 925235833
1692
1736
  EditorConfig:
1693
1737
  type: data
1694
1738
  color: "#fff1f2"
@@ -2144,6 +2188,7 @@ GLSL:
2144
2188
  - ".tese"
2145
2189
  - ".vert"
2146
2190
  - ".vrx"
2191
+ - ".vs"
2147
2192
  - ".vsh"
2148
2193
  - ".vshader"
2149
2194
  tm_scope: source.glsl
@@ -2205,20 +2250,20 @@ Gemini:
2205
2250
  wrap: true
2206
2251
  tm_scope: source.gemini
2207
2252
  language_id: 310828396
2208
- Genero:
2253
+ Genero 4gl:
2209
2254
  type: programming
2210
2255
  color: "#63408e"
2211
2256
  extensions:
2212
2257
  - ".4gl"
2213
- tm_scope: source.genero
2258
+ tm_scope: source.genero-4gl
2214
2259
  ace_mode: text
2215
2260
  language_id: 986054050
2216
- Genero Forms:
2261
+ Genero per:
2217
2262
  type: markup
2218
2263
  color: "#d8df39"
2219
2264
  extensions:
2220
2265
  - ".per"
2221
- tm_scope: source.genero-forms
2266
+ tm_scope: source.genero-per
2222
2267
  ace_mode: text
2223
2268
  language_id: 902995658
2224
2269
  Genie:
@@ -2316,7 +2361,6 @@ Gherkin:
2316
2361
  Git Attributes:
2317
2362
  type: data
2318
2363
  color: "#F44D27"
2319
- group: INI
2320
2364
  aliases:
2321
2365
  - gitattributes
2322
2366
  filenames:
@@ -2361,6 +2405,24 @@ Gleam:
2361
2405
  - ".gleam"
2362
2406
  tm_scope: source.gleam
2363
2407
  language_id: 1054258749
2408
+ Glimmer JS:
2409
+ type: programming
2410
+ extensions:
2411
+ - ".gjs"
2412
+ ace_mode: javascript
2413
+ color: "#F5835F"
2414
+ tm_scope: source.gjs
2415
+ group: JavaScript
2416
+ language_id: 5523150
2417
+ Glimmer TS:
2418
+ type: programming
2419
+ extensions:
2420
+ - ".gts"
2421
+ ace_mode: typescript
2422
+ color: "#3178c6"
2423
+ tm_scope: source.gts
2424
+ group: TypeScript
2425
+ language_id: 95110458
2364
2426
  Glyph:
2365
2427
  type: programming
2366
2428
  color: "#c1ac7f"
@@ -2489,6 +2551,15 @@ Gradle:
2489
2551
  tm_scope: source.groovy.gradle
2490
2552
  ace_mode: text
2491
2553
  language_id: 136
2554
+ Gradle Kotlin DSL:
2555
+ group: Gradle
2556
+ type: data
2557
+ color: "#02303a"
2558
+ extensions:
2559
+ - ".gradle.kts"
2560
+ ace_mode: text
2561
+ tm_scope: source.kotlin
2562
+ language_id: 432600901
2492
2563
  Grammatical Framework:
2493
2564
  type: programming
2494
2565
  aliases:
@@ -2603,8 +2674,8 @@ HOCON:
2603
2674
  extensions:
2604
2675
  - ".hocon"
2605
2676
  filenames:
2606
- - .scalafix.conf
2607
- - .scalafmt.conf
2677
+ - ".scalafix.conf"
2678
+ - ".scalafmt.conf"
2608
2679
  tm_scope: source.hocon
2609
2680
  ace_mode: text
2610
2681
  language_id: 679725279
@@ -2812,6 +2883,8 @@ Hosts File:
2812
2883
  filenames:
2813
2884
  - HOSTS
2814
2885
  - hosts
2886
+ aliases:
2887
+ - hosts
2815
2888
  tm_scope: source.hosts
2816
2889
  ace_mode: text
2817
2890
  language_id: 231021894
@@ -2910,7 +2983,6 @@ Idris:
2910
2983
  Ignore List:
2911
2984
  type: data
2912
2985
  color: "#000000"
2913
- group: INI
2914
2986
  aliases:
2915
2987
  - ignore
2916
2988
  - gitignore
@@ -3071,6 +3143,7 @@ JSON:
3071
3143
  aliases:
3072
3144
  - geojson
3073
3145
  - jsonl
3146
+ - sarif
3074
3147
  - topojson
3075
3148
  extensions:
3076
3149
  - ".json"
@@ -3084,6 +3157,7 @@ JSON:
3084
3157
  - ".JSON-tmLanguage"
3085
3158
  - ".jsonl"
3086
3159
  - ".mcmeta"
3160
+ - ".sarif"
3087
3161
  - ".tfstate"
3088
3162
  - ".tfstate.backup"
3089
3163
  - ".topojson"
@@ -3104,6 +3178,7 @@ JSON:
3104
3178
  - ".watchmanconfig"
3105
3179
  - Pipfile.lock
3106
3180
  - composer.lock
3181
+ - deno.lock
3107
3182
  - flake.lock
3108
3183
  - mcmod.info
3109
3184
  language_id: 174
@@ -3120,6 +3195,7 @@ JSON with Comments:
3120
3195
  extensions:
3121
3196
  - ".jsonc"
3122
3197
  - ".code-snippets"
3198
+ - ".code-workspace"
3123
3199
  - ".sublime-build"
3124
3200
  - ".sublime-commands"
3125
3201
  - ".sublime-completions"
@@ -3623,6 +3699,14 @@ Lean:
3623
3699
  tm_scope: source.lean
3624
3700
  ace_mode: text
3625
3701
  language_id: 197
3702
+ Lean 4:
3703
+ type: programming
3704
+ group: Lean
3705
+ extensions:
3706
+ - ".lean"
3707
+ tm_scope: source.lean4
3708
+ ace_mode: text
3709
+ language_id: 455147478
3626
3710
  Less:
3627
3711
  type: markup
3628
3712
  color: "#1d365d"
@@ -4210,6 +4294,16 @@ Module Management System:
4210
4294
  tm_scope: none
4211
4295
  ace_mode: text
4212
4296
  language_id: 235
4297
+ Mojo:
4298
+ type: programming
4299
+ color: "#ff4c1f"
4300
+ extensions:
4301
+ - ".mojo"
4302
+ ace_mode: python
4303
+ codemirror_mode: python
4304
+ codemirror_mime_type: text/x-python
4305
+ tm_scope: source.mojo
4306
+ language_id: 1045019587
4213
4307
  Monkey:
4214
4308
  type: programming
4215
4309
  extensions:
@@ -4374,7 +4468,7 @@ Nasal:
4374
4468
  extensions:
4375
4469
  - ".nas"
4376
4470
  tm_scope: source.nasal
4377
- ace_mode: text
4471
+ ace_mode: nasal
4378
4472
  language_id: 178322513
4379
4473
  Nearley:
4380
4474
  type: programming
@@ -4622,6 +4716,13 @@ OCaml:
4622
4716
  - ocamlscript
4623
4717
  tm_scope: source.ocaml
4624
4718
  language_id: 255
4719
+ Oberon:
4720
+ type: programming
4721
+ extensions:
4722
+ - ".ob2"
4723
+ tm_scope: source.modula2
4724
+ ace_mode: text
4725
+ language_id: 677210597
4625
4726
  ObjDump:
4626
4727
  type: data
4627
4728
  extensions:
@@ -4823,6 +4924,8 @@ Option List:
4823
4924
  - ackrc
4824
4925
  filenames:
4825
4926
  - ".ackrc"
4927
+ - ".rspec"
4928
+ - ".yardopts"
4826
4929
  - ackrc
4827
4930
  - mocha.opts
4828
4931
  tm_scope: source.opts
@@ -5101,6 +5204,8 @@ Pic:
5101
5204
  extensions:
5102
5205
  - ".pic"
5103
5206
  - ".chem"
5207
+ aliases:
5208
+ - pikchr
5104
5209
  ace_mode: text
5105
5210
  codemirror_mode: troff
5106
5211
  codemirror_mime_type: text/troff
@@ -5142,6 +5247,15 @@ Pike:
5142
5247
  tm_scope: source.pike
5143
5248
  ace_mode: text
5144
5249
  language_id: 287
5250
+ Pip Requirements:
5251
+ type: data
5252
+ color: "#FFD343"
5253
+ filenames:
5254
+ - requirements-dev.txt
5255
+ - requirements.txt
5256
+ ace_mode: text
5257
+ tm_scope: source.pip-requirements
5258
+ language_id: 684385621
5145
5259
  PlantUML:
5146
5260
  type: data
5147
5261
  color: "#fbbd16"
@@ -5257,6 +5371,14 @@ PowerShell:
5257
5371
  interpreters:
5258
5372
  - pwsh
5259
5373
  language_id: 293
5374
+ Praat:
5375
+ type: programming
5376
+ color: "#c8506d"
5377
+ tm_scope: source.praat
5378
+ ace_mode: praat
5379
+ extensions:
5380
+ - ".praat"
5381
+ language_id: 106029007
5260
5382
  Prisma:
5261
5383
  type: data
5262
5384
  color: "#0c344b"
@@ -5526,7 +5648,6 @@ R:
5526
5648
  type: programming
5527
5649
  color: "#198CE7"
5528
5650
  aliases:
5529
- - R
5530
5651
  - Rscript
5531
5652
  - splus
5532
5653
  extensions:
@@ -5851,6 +5972,14 @@ RenderScript:
5851
5972
  tm_scope: none
5852
5973
  ace_mode: text
5853
5974
  language_id: 323
5975
+ Rez:
5976
+ type: programming
5977
+ extensions:
5978
+ - ".r"
5979
+ tm_scope: source.rez
5980
+ ace_mode: text
5981
+ color: "#FFDAB3"
5982
+ language_id: 498022874
5854
5983
  Rich Text Format:
5855
5984
  type: markup
5856
5985
  extensions:
@@ -5882,6 +6011,14 @@ RobotFramework:
5882
6011
  tm_scope: text.robot
5883
6012
  ace_mode: text
5884
6013
  language_id: 324
6014
+ Roc:
6015
+ type: programming
6016
+ color: "#7c38f5"
6017
+ extensions:
6018
+ - ".roc"
6019
+ tm_scope: source.roc
6020
+ ace_mode: text
6021
+ language_id: 440182480
5885
6022
  Roff:
5886
6023
  type: markup
5887
6024
  color: "#ecdebe"
@@ -6389,6 +6526,7 @@ Shell:
6389
6526
  - ".kshrc"
6390
6527
  - ".login"
6391
6528
  - ".profile"
6529
+ - ".tmux.conf"
6392
6530
  - ".zlogin"
6393
6531
  - ".zlogout"
6394
6532
  - ".zprofile"
@@ -6406,6 +6544,7 @@ Shell:
6406
6544
  - login
6407
6545
  - man
6408
6546
  - profile
6547
+ - tmux.conf
6409
6548
  - zlogin
6410
6549
  - zlogout
6411
6550
  - zprofile
@@ -6499,7 +6638,7 @@ Slash:
6499
6638
  Slice:
6500
6639
  type: programming
6501
6640
  color: "#003fa2"
6502
- tm_scope: source.slice
6641
+ tm_scope: source.ice
6503
6642
  ace_mode: text
6504
6643
  extensions:
6505
6644
  - ".ice"
@@ -6514,6 +6653,14 @@ Slim:
6514
6653
  codemirror_mode: slim
6515
6654
  codemirror_mime_type: text/x-slim
6516
6655
  language_id: 350
6656
+ Slint:
6657
+ type: markup
6658
+ color: "#2379F4"
6659
+ extensions:
6660
+ - ".slint"
6661
+ tm_scope: source.slint
6662
+ ace_mode: text
6663
+ language_id: 119900149
6517
6664
  SmPL:
6518
6665
  type: programming
6519
6666
  extensions:
@@ -6740,7 +6887,7 @@ Svelte:
6740
6887
  language_id: 928734530
6741
6888
  Sway:
6742
6889
  type: programming
6743
- color: "#dea584"
6890
+ color: "#00F58C"
6744
6891
  extensions:
6745
6892
  - ".sw"
6746
6893
  tm_scope: source.sway
@@ -6748,6 +6895,14 @@ Sway:
6748
6895
  codemirror_mode: rust
6749
6896
  codemirror_mime_type: text/x-rustsrc
6750
6897
  language_id: 271471144
6898
+ Sweave:
6899
+ type: prose
6900
+ color: "#198ce7"
6901
+ extensions:
6902
+ - ".rnw"
6903
+ tm_scope: text.tex.latex.sweave
6904
+ ace_mode: tex
6905
+ language_id: 558779190
6751
6906
  Swift:
6752
6907
  type: programming
6753
6908
  color: "#F05138"
@@ -6776,15 +6931,13 @@ TI Program:
6776
6931
  color: "#A0AA87"
6777
6932
  extensions:
6778
6933
  - ".8xp"
6779
- - ".8xk"
6780
- - ".8xk.txt"
6781
6934
  - ".8xp.txt"
6782
6935
  language_id: 422
6783
- tm_scope: none
6936
+ tm_scope: source.8xp
6784
6937
  TL-Verilog:
6785
6938
  type: programming
6786
6939
  extensions:
6787
- - ".tlv"
6940
+ - ".tlv"
6788
6941
  tm_scope: source.tlverilog
6789
6942
  ace_mode: verilog
6790
6943
  color: "#C40023"
@@ -6939,6 +7092,17 @@ Terra:
6939
7092
  interpreters:
6940
7093
  - lua
6941
7094
  language_id: 371
7095
+ Terraform Template:
7096
+ type: markup
7097
+ extensions:
7098
+ - ".tftpl"
7099
+ color: "#7b42bb"
7100
+ tm_scope: source.hcl.terraform
7101
+ ace_mode: ruby
7102
+ codemirror_mode: ruby
7103
+ codemirror_mime_type: text/x-ruby
7104
+ group: HCL
7105
+ language_id: 856832701
6942
7106
  Texinfo:
6943
7107
  type: prose
6944
7108
  wrap: true
@@ -6992,6 +7156,14 @@ Text:
6992
7156
  tm_scope: none
6993
7157
  ace_mode: text
6994
7158
  language_id: 372
7159
+ TextGrid:
7160
+ type: data
7161
+ color: "#c8506d"
7162
+ tm_scope: source.textgrid
7163
+ ace_mode: text
7164
+ extensions:
7165
+ - ".TextGrid"
7166
+ language_id: 965696054
6995
7167
  TextMate Properties:
6996
7168
  type: data
6997
7169
  color: "#df66e4"
@@ -7023,6 +7195,14 @@ Thrift:
7023
7195
  - ".thrift"
7024
7196
  ace_mode: text
7025
7197
  language_id: 374
7198
+ Toit:
7199
+ type: programming
7200
+ color: "#c2c9fb"
7201
+ extensions:
7202
+ - ".toit"
7203
+ tm_scope: source.toit
7204
+ ace_mode: text
7205
+ language_id: 356554395
7026
7206
  Turing:
7027
7207
  type: programming
7028
7208
  color: "#cf142b"
@@ -7077,6 +7257,16 @@ TypeScript:
7077
7257
  codemirror_mode: javascript
7078
7258
  codemirror_mime_type: application/typescript
7079
7259
  language_id: 378
7260
+ Typst:
7261
+ type: programming
7262
+ color: "#239dad"
7263
+ aliases:
7264
+ - typ
7265
+ extensions:
7266
+ - ".typ"
7267
+ tm_scope: source.typst
7268
+ ace_mode: text
7269
+ language_id: 704730682
7080
7270
  Unified Parallel C:
7081
7271
  type: programming
7082
7272
  color: "#4e3617"
@@ -7654,6 +7844,7 @@ XML:
7654
7844
  - ".mjml"
7655
7845
  - ".mm"
7656
7846
  - ".mod"
7847
+ - ".mojo"
7657
7848
  - ".mxml"
7658
7849
  - ".natvis"
7659
7850
  - ".ncl"
@@ -7687,6 +7878,7 @@ XML:
7687
7878
  - ".tml"
7688
7879
  - ".ts"
7689
7880
  - ".tsx"
7881
+ - ".typ"
7690
7882
  - ".ui"
7691
7883
  - ".urdf"
7692
7884
  - ".ux"
@@ -8045,6 +8237,13 @@ jq:
8045
8237
  type: programming
8046
8238
  extensions:
8047
8239
  - ".jq"
8240
+ interpreters:
8241
+ - gojq
8242
+ - jaq
8243
+ - jq
8244
+ - jqjq
8245
+ - jqq
8246
+ - query-json
8048
8247
  tm_scope: source.jq
8049
8248
  language_id: 905371884
8050
8249
  kvlang:
package/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ISC License
2
2
 
3
- Copyright &copy; Nixinova 2021&ndash;2022
3
+ Copyright &copy; Nixinova 2021&ndash;2024
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
6
6
  purpose with or without fee is hereby granted, provided that the above
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linguist-js",
3
- "version": "2.7.0-pre",
3
+ "version": "2.7.1",
4
4
  "description": "Analyse languages used in a folder. Powered by GitHub Linguist, although it doesn't need to be installed.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -11,10 +11,10 @@
11
11
  "node": ">=12"
12
12
  },
13
13
  "scripts": {
14
- "download-files": "npx tsx@3 build/download-files",
14
+ "download-files": "npx tsx@4 build/download-files",
15
15
  "pre-publish": "npm run download-files && npm test && npm run perf",
16
16
  "perf": "tsc && node test/perf",
17
- "test": "tsc && node test/folder && echo --- && node test/unit"
17
+ "test": "tsc && node test/folder && node test/unit"
18
18
  },
19
19
  "files": [
20
20
  "bin/",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://github.com/Nixinova/Linguist#readme",
40
40
  "dependencies": {
41
- "binary-extensions": "^2.2.0",
41
+ "binary-extensions": "^2.2.0 <3",
42
42
  "commander": "^9.5.0 <10",
43
43
  "common-path-prefix": "^3.0.0",
44
44
  "cross-fetch": "^3.1.8 <4",
package/readme.md CHANGED
@@ -95,9 +95,17 @@ Running LinguistJS on this folder will return the following JSON:
95
95
 
96
96
  ```js
97
97
  const linguist = require('linguist-js');
98
- let folder = './src';
99
- let options = { keepVendored: false, quick: false };
100
- const { files, languages, unknown } = linguist(folder, options);
98
+
99
+ // Analyse folder on disc
100
+ const folder = './src';
101
+ const options = { keepVendored: false, quick: false };
102
+ const { files, languages, unknown } = await linguist(folder, options);
103
+
104
+ // Analyse file content from raw input
105
+ const fileNames = ['file1.ts', 'file2.ts', 'ignoreme.js'];
106
+ const fileContent = ['#!/usr/bin/env node', 'console.log("Example");', '"ignored"'];
107
+ const options = { ignoredFiles: ['ignore*'] };
108
+ const { files, languages, unknown } = await linguist(fileNames, { fileContent, ...options });
101
109
  ```
102
110
 
103
111
  - `linguist(entry?, opts?)` (default export):
@@ -122,7 +130,7 @@ const { files, languages, unknown } = linguist(folder, options);
122
130
  Alias for `checkAttributes:false, checkIgnored:false, checkHeuristics:false, checkShebang:false, checkModeline:false`.
123
131
  - `offline` (boolean):
124
132
  Whether to use pre-packaged metadata files instead of fetching them from GitHub at runtime (defaults to `false`).
125
- - `keepVendored` (boolean):
133
+ - `keepVendored` (boolean):
126
134
  Whether to keep vendored files (dependencies, etc) (defaults to `false`).
127
135
  Does nothing when `fileContent` is set.
128
136
  - `keepBinary` (boolean):