Skip to content

Commit

Permalink
fix: language precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
harrydowning committed Jul 5, 2024
1 parent f188198 commit 09fd94b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### Fixed

- Extension update bug (Issue [#24](https://github.com/harrydowning/yaml-embedded-languages/issues/24))
- User languages reset on extension update (Issue [#24](https://github.com/harrydowning/yaml-embedded-languages/issues/24))
- User language override precedence

## [0.3.1] - 2024-06-29

Expand Down
20 changes: 13 additions & 7 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const LANGUAGES = {
c: "source.c",
clojure: "source.clojure",
coffee: "source.coffee",
"cpp|c\\+\\+": "source.cpp",
cpp: "source.cpp",
"c\\+\\+": "source.cpp",
csharp: "source.csharp",
css: "source.css",
diff: "source.diff",
Expand All @@ -27,19 +28,23 @@ const LANGUAGES = {
groovy: "source.groovy",
html: "text.html.derivative",
java: "source.java",
"javascript|js": "source.js",
javascript: "source.js",
js: "source.js",
json: "source.json",
"tex|latex": "text.tex",
tex: "text.tex",
latex: "text.tex",
lua: "source.lua",
makefile: "source.makefile",
markdown: "text.html.markdown",
objc: "source.objc",
perl: "source.perl",
"pip|requirements": "source.pip-requirements",
pip: "source.pip-requirements",
requirements: "source.pip-requirements",
powerfx: "source.js",
powershell: "source.powershell",
properties: "source.properties",
"python|py": "source.python",
python: "source.python",
py: "source.python",
r: "source.r",
regex: "source.regexp.python",
ruby: "source.ruby",
Expand All @@ -50,7 +55,8 @@ const LANGUAGES = {
slim: "source.slim",
sql: "source.sql",
swift: "source.swift",
"typescript|ts": "source.ts",
typescript: "source.ts",
ts: "source.ts",
tsx: "source.tsx",
xml: "text.xml",
yaml: "source.yaml",
Expand Down Expand Up @@ -208,7 +214,7 @@ const generateFiles = (languages = LANGUAGES) => {
const updateExtension = () => {
const settings = vscode.workspace.getConfiguration(NAME);
const includeLanguages = settings[SUB_INCLUDE_CONFIG];
const allLanguages = { ...includeLanguages, ...LANGUAGES };
const allLanguages = { ...LANGUAGES, ...includeLanguages };

const filesChanged = generateFiles(allLanguages);

Expand Down

0 comments on commit 09fd94b

Please sign in to comment.