Skip to content

Commit bed0555

Browse files
committed
main: Repository Init Commit
0 parents  commit bed0555

11 files changed

Lines changed: 1147 additions & 0 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TODO.md
2+
.vscode/
3+
images/

.vscodeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode/**
2+
.vscode-test/**
3+
.gitignore
4+
vsc-extension-quickstart.md

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to the "arm-syntax" extension will be documented in this file.
4+
5+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6+
7+
## [Unreleased]
8+
9+
- Initial release

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# ARM Syntax README
2+
3+
## Author
4+
5+
Javier Mejias Reverté
6+
[GitHub Profile](https://github.com/ininavicode)
7+
8+
---
9+
10+
## Features
11+
12+
Color Syntax Highlighting for ARM Assembly (keywords from **The ARM Instruction Set - ARM University Program - V1.0</**)
13+
Instruction Set is adapted for **URV - ETSE - DEIM - Computadors**
14+
15+
Color Syntax Highlighting is applied to the following file extensions:
16+
- .s
17+
- .arm
18+
- .asm
19+
- .i
20+
21+
Configurable color, bold, italic for each keyword type.
22+
23+
---
24+
25+
## Installing
26+
27+
### From VSCode
28+
29+
1. Open **Extensions** in VSCode
30+
2. Click the **"..."** button at the top right of the Extensions window
31+
3. Select **Install from VSIX**
32+
4. Choose your **.vsix file**
33+
34+
---
35+
36+
## Requirements
37+
38+
None required.
39+
40+
---
41+
42+
## Extension Settings
43+
44+
- **Color**
45+
- **Bold** (On/Off)
46+
- **Italic** (On/Off)
47+
48+
---
49+
50+
### How to configure
51+
52+
1. Press Ctrl + ,
53+
2. Search for **ARM Syntax Settings**
54+
55+
---
56+
57+
## Known Issues
58+
59+
None known at this time.
60+
61+
---
62+
63+
## Release Notes
64+
65+
### V0.0.1
66+
Extension release
67+
68+
### V0.0.2
69+
Corrected detection for comments
70+
71+
### V0.0.3
72+
Changed default colors
73+
74+
### V0.0.4
75+
**swi** keyword added to mnemonics

arm-syntax-0.0.4.vsix

13.5 KB
Binary file not shown.

extension.js

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
const vscode = require('vscode');
2+
3+
function activate(context) {
4+
const updateColors = () => {
5+
const colorsConfig = vscode.workspace.getConfiguration('armSyntax.colors');
6+
const boldConfig = vscode.workspace.getConfiguration('armSyntax.bold');
7+
const italicConfig = vscode.workspace.getConfiguration('armSyntax.italic');
8+
const editorConfig = vscode.workspace.getConfiguration('editor');
9+
10+
const createFontStyle = (bold, italic) => {
11+
let styles = [];
12+
if (bold) styles.push("bold");
13+
if (italic) styles.push("italic");
14+
return styles.join(" ");
15+
};
16+
17+
const tokenColorCustomizations = {
18+
textMateRules: [
19+
{
20+
scope: "keyword.mnemonic.arm",
21+
settings: {
22+
foreground: colorsConfig.get('mnemonics', '#3E69E2'),
23+
fontStyle: createFontStyle(
24+
boldConfig.get('mnemonics', true),
25+
italicConfig.get('mnemonics', false)
26+
)
27+
}
28+
},
29+
{
30+
scope: "comment.line.arm",
31+
settings: {
32+
foreground: colorsConfig.get('comments', '#7EC699'),
33+
fontStyle: createFontStyle(
34+
boldConfig.get('comments', false),
35+
italicConfig.get('comments', true)
36+
)
37+
}
38+
},
39+
{
40+
scope: "variable.register.arm",
41+
settings: {
42+
foreground: colorsConfig.get('registers', '#3E69E2'),
43+
fontStyle: createFontStyle(
44+
boldConfig.get('registers', false),
45+
italicConfig.get('registers', false)
46+
)
47+
}
48+
},
49+
{
50+
scope: "constant.numeric.arm",
51+
settings: {
52+
foreground: colorsConfig.get('constants', '#D34AD8'),
53+
fontStyle: createFontStyle(
54+
boldConfig.get('constants', false),
55+
italicConfig.get('constants', false)
56+
)
57+
}
58+
},
59+
{
60+
scope: "entity.name.label.arm",
61+
settings: {
62+
foreground: colorsConfig.get('labels', '#ECB827'),
63+
fontStyle: createFontStyle(
64+
boldConfig.get('labels', false),
65+
italicConfig.get('labels', false)
66+
)
67+
}
68+
},
69+
{
70+
scope: "support.directive.arm",
71+
settings: {
72+
foreground: colorsConfig.get('directives', '#FD4444'),
73+
fontStyle: createFontStyle(
74+
boldConfig.get('directives', false),
75+
italicConfig.get('directives', false)
76+
)
77+
}
78+
},
79+
{
80+
scope: "displacement_op2.arm",
81+
settings: {
82+
foreground: colorsConfig.get('displacements', '#E8F348'),
83+
fontStyle: createFontStyle(
84+
boldConfig.get('displacements', false),
85+
italicConfig.get('displacements', false)
86+
)
87+
}
88+
}
89+
]
90+
};
91+
92+
editorConfig.update(
93+
'tokenColorCustomizations',
94+
tokenColorCustomizations,
95+
vscode.ConfigurationTarget.Workspace
96+
);
97+
};
98+
99+
// Update colors when the extension activates
100+
updateColors();
101+
102+
// Listen for configuration changes
103+
const disposable = vscode.workspace.onDidChangeConfiguration((event) => {
104+
if (
105+
event.affectsConfiguration('armSyntax.colors') ||
106+
event.affectsConfiguration('armSyntax.bold') ||
107+
event.affectsConfiguration('armSyntax.italic')
108+
) {
109+
updateColors();
110+
}
111+
});
112+
113+
context.subscriptions.push(disposable);
114+
}
115+
116+
function deactivate() {}
117+
118+
module.exports = {
119+
activate,
120+
deactivate
121+
};

language-configuration.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"comments": {
3+
// symbol used for single line comment. Remove this entry if your language does not support line comments
4+
"lineComment": "@;",
5+
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
6+
"blockComment": [ "/*", "*/" ]
7+
},
8+
// symbols used as brackets
9+
"brackets": [
10+
["{", "}"],
11+
["[", "]"],
12+
["(", ")"]
13+
],
14+
// symbols that are auto closed when typing
15+
"autoClosingPairs": [
16+
["{", "}"],
17+
["[", "]"],
18+
["(", ")"],
19+
["\"", "\""],
20+
["'", "'"]
21+
],
22+
// symbols that can be used to surround a selection
23+
"surroundingPairs": [
24+
["{", "}"],
25+
["[", "]"],
26+
["(", ")"],
27+
["\"", "\""],
28+
["'", "'"]
29+
]
30+
}

0 commit comments

Comments
 (0)