Skip to content

Commit 714266a

Browse files
committed
Adding code snippets
Code snippets and auto-complete using https://github.com/aminya/Matlab-Snippets - A full collection converted from official JSON files
1 parent 374e30d commit 714266a

File tree

156 files changed

+31216
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+31216
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Atom.io Package for MATLAB and Octave Language Support
22

3+
# Features:
4+
- Syntax highlighting using official MATLAB support mathworks/MATLAB-Language-grammar
5+
- Code snippets and auto-complete using https://github.com/aminya/Matlab-Snippets
6+
- A full collection converted from official JSON files
7+
- Documentation url in auto-complete (Click more)
8+
9+
Screenshot Example: preview of included file `highlighting-test.m`_
10+
![language-matlab-octave-highlighting](https://user-images.githubusercontent.com/43882944/61577281-29e12680-aab3-11e9-900d-527a0afa8e37.png)
11+
12+
13+
---------------------------------
14+
15+
# More information:
16+
317
## Version 1.0.0+ Major Update
418
**Breaking change:** as of v1 release August 2019, migrated MATLAB grammar source from TextMate to official MATLAB support mathworks/MATLAB-Language-grammar. This fixed many reported issues and improved MATLAB highlighting to match official [github/linguist](https://github.com/github/linguist) used on Github.com.
519

@@ -16,10 +30,6 @@ https://github.com/mathworks/MATLAB-Language-grammar
1630
#### Commit Hash: MATLAB-Language-grammar used for current grammar version
1731
https://github.com/mathworks/MATLAB-Language-grammar/tree/5915f67761daa34b5f0fb9daf3d266198219a472
1832

19-
#### Screenshot Example: preview of included file `highlighting-test.m`_
20-
![language-matlab-octave-highlighting](https://user-images.githubusercontent.com/43882944/61577281-29e12680-aab3-11e9-900d-527a0afa8e37.png)
21-
22-
2333
## Process for Updating MATLAB Grammar
2434
### Converting the MathWorks TextMate Grammar
2535
1. Clone, convert, and update the grammar:

snippets/aero_uicomponents_.cson

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# MATLAB snippets generated using https://github.com/aminya/Matlab-Snippets
2+
'.source.matlab, source.m':
3+
4+
"uiaerohorizon [aero]":
5+
prefix: "uiaerohorizon"
6+
body: '''uiaerohorizon(${1:Parent}, ${2:properties})'''
7+
description: '''[aero] Create artificial horizon component
8+
uiaerohorizon(Parent, properties)
9+
'''
10+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/ug/aero.ui.control.artificialhorizon.uiaerohorizon.html'
11+
12+
13+
"uiaeroairspeed [aero]":
14+
prefix: "uiaeroairspeed"
15+
body: '''uiaeroairspeed(${1:Parent}, ${2:properties})'''
16+
description: '''[aero] Create airspeed indicator component
17+
uiaeroairspeed(Parent, properties)
18+
'''
19+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/ug/aero.ui.control.airspeedindicator.uiaeroairspeed.html'
20+
21+
22+
"uiaerorpm [aero]":
23+
prefix: "uiaerorpm"
24+
body: '''uiaerorpm(${1:Parent}, ${2:properties})'''
25+
description: '''[aero] Create revolutions per minute (RPM) indicator component
26+
uiaerorpm(Parent, properties)
27+
'''
28+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/ug/aero.ui.control.rpmindicator.uiaerorpm.html'
29+
30+
31+
"uiaeroclimb [aero]":
32+
prefix: "uiaeroclimb"
33+
body: '''uiaeroclimb(${1:Parent}, ${2:properties})'''
34+
description: '''[aero] Create climb rate indicator component
35+
uiaeroclimb(Parent, properties)
36+
'''
37+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/ug/aero.ui.control.climbindicator.uiaeroclimb.html'
38+
39+
40+
"uiaeroturn [aero]":
41+
prefix: "uiaeroturn"
42+
body: '''uiaeroturn(${1:Parent}, ${2:properties})'''
43+
description: '''[aero] Create turn coordinator component
44+
uiaeroturn(Parent, properties)
45+
'''
46+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/ug/aero.ui.control.turncoordinator.uiaeroturn.html'
47+
48+
49+
"uiaeroheading [aero]":
50+
prefix: "uiaeroheading"
51+
body: '''uiaeroheading(${1:Parent}, ${2:properties})'''
52+
description: '''[aero] Create heading indicator component
53+
uiaeroheading(Parent, properties)
54+
'''
55+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/ug/aero.ui.control.headingindicator.uiaeroheading.html'
56+
57+
58+
"uiaeroegt [aero]":
59+
prefix: "uiaeroegt"
60+
body: '''uiaeroegt(${1:Parent}, ${2:properties})'''
61+
description: '''[aero] Create exhaust gas temperature (EGT) indicator component
62+
uiaeroegt(Parent, properties)
63+
'''
64+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/ug/aero.ui.control.egtindicator.uiaeroegt.html'
65+
66+
67+
"uiaeroaltimeter [aero]":
68+
prefix: "uiaeroaltimeter"
69+
body: '''uiaeroaltimeter(${1:Parent}, ${2:properties})'''
70+
description: '''[aero] Create altimeter component
71+
uiaeroaltimeter(Parent, properties)
72+
'''
73+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/ug/aero.ui.control.altimeter.uiaeroaltimeter.html'
74+

snippets/coder_coder_.cson

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MATLAB snippets generated using https://github.com/aminya/Matlab-Snippets
2+
'.source.matlab, source.m':
3+
4+
"coder.config [coder]":
5+
prefix: "coder.config"
6+
body: '''coder.config(${1:build_type}, 'ecoder', ${2:value})'''
7+
description: '''[coder] Create MATLAB
8+
Coder code generation configuration objects
9+
coder.config(build_type, 'ecoder', value)
10+
'''
11+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/ref/coder.config.html'
12+
13+
14+
"coder.OutputType [coder]":
15+
prefix: "coder.OutputType"
16+
body: '''coder.OutputType(${1:name})'''
17+
description: '''[coder]
18+
coder.OutputType(name)
19+
'''
20+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.OutputType.html'
21+

snippets/coder_connectivity_.cson

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# MATLAB snippets generated using https://github.com/aminya/Matlab-Snippets
2+
'.source.matlab, source.m':
3+
4+
"buildStandaloneCoderAssumptions [coder]":
5+
prefix: "buildStandaloneCoderAssumptions"
6+
body: '''buildStandaloneCoderAssumptions(${1:buildFolder})'''
7+
description: '''[coder] Create application to check code generator assumptions
8+
buildStandaloneCoderAssumptions(buildFolder)
9+
'''
10+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/ref/buildstandalonecoderassumptions.html'
11+

snippets/coder_embeddedcoder_.cson

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# MATLAB snippets generated using https://github.com/aminya/Matlab-Snippets
2+
'.source.matlab, source.m':
3+
4+
"coder.dictionary.Entry.set [coder]":
5+
prefix: "coder.dictionary.Entry.set"
6+
body: '''coder.dictionary.Entry.set(${1:entryObj}, ${2:pName1}, ${3:pValue1})'''
7+
description: '''[coder]
8+
coder.dictionary.Entry.set(entryObj, pName1, pValue1)
9+
'''
10+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.dictionary.Entry.set.html'
11+
12+
13+
"coder.Dictionary.getSection [coder]":
14+
prefix: "coder.Dictionary.getSection"
15+
body: '''${1:outputValue1} = coder.Dictionary.getSection(${1:dictionaryObj}, ${2:sectionName})'''
16+
description: '''[coder]
17+
outputValue1 = coder.Dictionary.getSection(dictionaryObj, sectionName)
18+
'''
19+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.Dictionary.getSection.html'
20+
21+
22+
"coder.dictionary.Entry.get [coder]":
23+
prefix: "coder.dictionary.Entry.get"
24+
body: '''${1:outputValue1} = coder.dictionary.Entry.get(${1:entryObj}, ${2:pName1})'''
25+
description: '''[coder]
26+
outputValue1 = coder.dictionary.Entry.get(entryObj, pName1)
27+
'''
28+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.dictionary.Entry.get.html'
29+

snippets/coder_matlabcoder_.cson

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# MATLAB snippets generated using https://github.com/aminya/Matlab-Snippets
2+
'.source.matlab, source.m':
3+
4+
"coder [coder]":
5+
prefix: "coder"
6+
body: '''coder('-toconfig', ${1:value})'''
7+
description: '''[coder] Open MATLAB
8+
Coder app
9+
coder('-toconfig', value)
10+
'''
11+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/ref/coder.html'
12+
13+
14+
"codegen [coder]":
15+
prefix: "codegen"
16+
body: '''codegen(${1:compile_only}, ${2:config_flag}, ${3:debug}, ${4:report}, ${5:launchreport}, '-reportinfo', ${6:value}, ${7:rowmajor}, ${8:preservearraydims}, ${9:file}, '-d', ${10:value}, '-I', ${11:value}, '-globals', ${12:value}, '-o', ${13:value}, '-O', ${14:value}, '-args', ${15:value}, '-config', ${16:value}, ${17:verbose}, ${18:singleC}, '-test', ${19:value}, ${20:jit}, ${21:lang}, ${22:langstd}, '-toproject', ${23:value})'''
17+
description: '''[coder] Generate C/C++ code from
18+
MATLAB code
19+
codegen(compile_only, config_flag, debug, report, launchreport, '-reportinfo', value, rowmajor, preservearraydims, file, '-d', value, '-I', value, '-globals', value, '-o', value, '-O', value, '-args', value, '-config', value, verbose, singleC, '-test', value, jit, lang, langstd, '-toproject', value)
20+
'''
21+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/ref/codegen.html'
22+

snippets/coder_simulinkcoder_.cson

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# MATLAB snippets generated using https://github.com/aminya/Matlab-Snippets
2+
'.source.matlab, source.m':
3+
4+
"crossReleaseImport [coder]":
5+
prefix: "crossReleaseImport"
6+
body: '''${1:blockHandle} = crossReleaseImport(${1:buildFolder}, ${2:configset}, 'SimulationMode', ${3:value}, 'DataDictionary', ${4:value}, 'ConfigParams', ${5:value}, 'SFunctionName', ${6:value}, 'OriginalPaths', ${7:value}, 'ReplacementPaths', ${8:value})'''
7+
description: '''[coder] Import generated model code from a previous release as
8+
SIL or PIL blocks
9+
blockHandle = crossReleaseImport(buildFolder, configset, 'SimulationMode', value, 'DataDictionary', value, 'ConfigParams', value, 'SFunctionName', value, 'OriginalPaths', value, 'ReplacementPaths', value)
10+
'''
11+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/ref/crossreleaseimport.html'
12+

snippets/coder_xcp_.cson

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# MATLAB snippets generated using https://github.com/aminya/Matlab-Snippets
2+
'.source.matlab, source.m':
3+
4+
"coder.xcp.a2l.addCoderXCPInfo [coder]":
5+
prefix: "coder.xcp.a2l.addCoderXCPInfo"
6+
body: '''coder.xcp.a2l.addCoderXCPInfo(${1:buildDir}, 'MergeMdlRefs', ${2:value}, 'SetAddress', ${3:value}, 'InputFile', ${4:value}, 'OutputFile', ${5:value})'''
7+
description: '''[coder]
8+
coder.xcp.a2l.addCoderXCPInfo(buildDir, 'MergeMdlRefs', value, 'SetAddress', value, 'InputFile', value, 'OutputFile', value)
9+
'''
10+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.xcp.a2l.addCoderXCPInfo.html'
11+

snippets/coder_xrel_.cson

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# MATLAB snippets generated using https://github.com/aminya/Matlab-Snippets
2+
'.source.matlab, source.m':
3+
4+
"sharedCodeUpdate [coder]":
5+
prefix: "sharedCodeUpdate"
6+
body: '''sharedCodeUpdate(${1:sourceFolder}, ${2:destinationFolder}, 'ExistingCodeSubfolder', ${3:value})'''
7+
description: '''[coder] Add new shared code source files to existing shared code
8+
folder
9+
sharedCodeUpdate(sourceFolder, destinationFolder, 'ExistingCodeSubfolder', value)
10+
'''
11+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/ref/sharedcodeupdate.html'
12+

0 commit comments

Comments
 (0)