Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): partial improvement of config syntax highlighting #612

Merged
merged 51 commits into from
Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
fdb7328
image fix, grammar fix
freasy Mar 29, 2021
0a1b3f7
Merge remote-tracking branch 'upstream/master'
freasy Mar 29, 2021
639cbe4
Merge remote-tracking branch 'upstream/master'
freasy Apr 3, 2021
e6af5e0
Merge remote-tracking branch 'upstream/master'
freasy Apr 6, 2021
e6b08ff
fixed suggestions bug, some cleanup from old editor, svg edge case
freasy Apr 8, 2021
a232499
Merge remote-tracking branch 'upstream/master'
freasy Apr 9, 2021
3db33e3
Merge remote-tracking branch 'upstream/master'
freasy Apr 11, 2021
512c84d
Merge branch 'master' into develop
freasy Apr 11, 2021
ae37c7f
Merge remote-tracking branch 'upstream/master'
freasy Apr 11, 2021
ef64aeb
Merge remote-tracking branch 'upstream/master'
freasy Apr 14, 2021
bd28f5c
FIX: save a file with special characters
freasy Apr 23, 2021
30f6868
Merge remote-tracking branch 'upstream/master'
freasy May 2, 2021
749cc12
Merge remote-tracking branch 'upstream/master'
freasy Jun 4, 2021
43f59e5
Merge remote-tracking branch 'upstream/master'
freasy Jun 5, 2021
add2816
DOCU: new community theme, multi cam setup
freasy Jun 10, 2021
95a72ec
Merge remote-tracking branch 'main/develop'
freasy Oct 10, 2021
bf59cb6
Merge branch 'master' into develop
freasy Oct 10, 2021
020ec49
Merge remote-tracking branch 'main/develop' into develop
freasy Oct 11, 2021
c3822e3
Merge remote-tracking branch 'main/develop' into develop
freasy Oct 12, 2021
8c76b79
Merge remote-tracking branch 'main/develop' into develop
freasy Oct 19, 2021
edccdac
Merge remote-tracking branch 'main/develop' into develop
freasy Oct 24, 2021
2a57bc2
Merge remote-tracking branch 'main/develop' into develop
freasy Oct 30, 2021
ed16a8a
Merge remote-tracking branch 'main/develop' into develop
freasy Nov 16, 2021
b7b09e0
Merge remote-tracking branch 'main/develop' into develop
freasy Nov 17, 2021
f027bae
Merge remote-tracking branch 'main/develop' into develop
freasy Dec 9, 2021
ffd053c
Merge remote-tracking branch 'main/develop' into develop
freasy Jan 2, 2022
5395771
Merge remote-tracking branch 'main/develop' into feature/fix_stream_p…
freasy Jan 25, 2022
e3dcd44
FIX: started to fix parser
freasy Jan 25, 2022
24a43e0
new klipper conf parser
freasy Jan 28, 2022
9aa4466
Merge remote-tracking branch 'main/develop' into develop
freasy Jan 28, 2022
5ed131e
Merge remote-tracking branch 'main/develop' into develop
freasy Feb 7, 2022
67c2504
Merge branch 'develop' into feature/fix_stream_parser
freasy Feb 7, 2022
eea62be
FIX: stream parser jinja fixes
freasy Feb 7, 2022
e93dd60
Merge remote-tracking branch 'main/develop' into feature/fix_stream_p…
freasy Feb 8, 2022
dec807c
merge
freasy Feb 8, 2022
f3cf77f
vite merge npm install
freasy Feb 8, 2022
5c0de34
Merge remote-tracking branch 'main/develop' into develop
freasy Feb 21, 2022
5a609cb
merged current develop
freasy Feb 25, 2022
a98883c
Merge remote-tracking branch 'main/develop' into develop
freasy Feb 28, 2022
687f7a2
Merge remote-tracking branch 'main/develop' into develop
freasy Mar 29, 2022
19bf820
Merge branch 'develop' into feature/fix_stream_parser
freasy Mar 29, 2022
3e0751b
FIX: multiline bugs
freasy Mar 29, 2022
db6b278
FIX: add other gcode possibilities
freasy Mar 29, 2022
3e66a4d
FIX: text is no jinja
freasy Mar 29, 2022
42aa93f
FIX: no match input
freasy Mar 29, 2022
93734a3
FIX: uncomplete pair fix
freasy Mar 29, 2022
2672693
Merge branch 'develop' into feature/fix_stream_parser
dw-0 Jun 29, 2022
4281f6a
refactor: move styles to bottom of file
dw-0 Jun 29, 2022
96b738b
refactor: remove unused packages
dw-0 Jun 29, 2022
fa4532b
fix(StreamParserGcode.ts): correct char for gcode comment
dw-0 Jun 29, 2022
d007bf2
refactor: remove empty styles
dw-0 Jun 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 5 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@
"changelog": "git cliff v0.0.4..$(git describe --tags $(git rev-list --tags --max-count=1)) --output CHANGELOG.md"
},
"dependencies": {
"@codemirror/basic-setup": "^0.19.0",
"@codemirror/highlight": "^0.19.6",
"@codemirror/basic-setup": "^0.19.1",
"@codemirror/highlight": "^0.19.7",
"@codemirror/lang-css": "^0.19.3",
"@codemirror/lang-javascript": "^0.19.3",
"@codemirror/lang-json": "^0.19.1",
"@codemirror/language": "^0.19.7",
"@codemirror/legacy-modes": "^0.19.0",
"@codemirror/search": "^0.19.4",
"@codemirror/state": "^0.19.6",
"@codemirror/stream-parser": "^0.19.2",
"@codemirror/view": "^0.19.28",
"@codemirror/search": "^0.19.6",
"@codemirror/stream-parser": "^0.19.5",
"@codemirror/view": "^0.19.42",
"@sindarius/gcodeviewer": "^3.1.0",
"@types/node": "^16.11.22",
"@types/overlayscrollbars": "^1.12.1",
Expand Down
5 changes: 0 additions & 5 deletions src/components/inputs/Codemirror.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<style>
.vue-codemirror .cm-editor {
}
</style>

<template>
<div class="vue-codemirror">
<div ref="codemirror" v-observe-visibility="visibilityChanged"></div>
Expand Down
30 changes: 20 additions & 10 deletions src/plugins/StreamParserGcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,51 @@ export const gcode = {

/* Klipper macro attributes */
if (stream.pos > zeroPos && state.klipperMacro) {
if (stream.match(/^\s*[A-Z_]+/)) return 'propertyName'
else if (stream.match(/^\s*[A-Za-z0-9_]+/)) return 'number'
else if (stream.match(/^{.*}/)) return 'variable'
stream.eatSpace()
if (stream.match(/^(".+"|true|false)/i)) {
return 'string'
} else if (stream.match(/^\d+/)) return 'number'
else if (stream.match(/^[A-Za-z\d_]+/)) return 'propertyName'
else if (zeroPos === 0 && stream.match(/^{[^%]+}/)) return 'variable'
}

/* comments */
if ([';', '#'].includes(ch ?? '')) {
if ([';'].includes(ch ?? '')) {
stream.skipToEnd()
return 'comment'
}

const isZero = stream.pos == zeroPos

/* Mxxx Gxxx commands */
if (stream.pos == zeroPos && stream.match(/[GMgm][\d]+/)) {
if (isZero && stream.match(/_?[GMgm][\d.]+/)) {
return 'namespace'
}

if (stream.string.substr(zeroPos).toLowerCase().startsWith('m117')) {
stream.skipToEnd()
return 'string'
}

/* G0/1 movements */
if (stream.pos > zeroPos && stream.match(/[XYZIJxyzij]-?([\d]*\.[\d]+|[\d]+)?/)) {
if (stream.pos > zeroPos && stream.match(/[EPXYZIJ]-?([\d]*\.[\d]+|[\d]+)?/i)) {
return 'className'
}

/* G0/1 speeds */
if (stream.pos > zeroPos && stream.match(/[Ff]-?([\d]*\.[\d]+|[\d]+)/)) {
if (stream.pos > zeroPos && stream.match(/[Ff]-?([\d]*\.[\d]+|[\d]+)?/)) {
return 'string'
}

/* G0/1 extrusions */
if (stream.pos > zeroPos && stream.match(/[TtSsEe]-?([\d]*\.[\d]+|[\d]+)/)) {
if (stream.pos > zeroPos && stream.match(/[TtSs]-?([\d]*\.[\d]+|[\d]+)?/)) {
return 'atom'
}

if (stream.pos > zeroPos && stream.match(/^{.*}/)) return 'propertyName'
if (zeroPos === 0 && stream.pos > zeroPos && stream.match(/^{[^%]+}/)) return 'propertyName'

/* Klipper macro names */
if (stream.pos == zeroPos && stream.match(/^[A-Z_]+/)) {
if (isZero && stream.match(/^\s*[A-Z_\d]+/)) {
state.klipperMacro = true
return 'name'
}
Expand Down
Loading