Skip to content

Commit 7a82b9a

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 7a82b9a

File tree

156 files changed

+24187
-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

+24187
-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: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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: '''uiaerohorizon(Parent, properties) [aero]'''
8+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/uiaerohorizon.html'
9+
10+
11+
"uiaeroairspeed [aero]":
12+
prefix: "uiaeroairspeed"
13+
body: '''uiaeroairspeed(${1:Parent}, ${2:properties})'''
14+
description: '''uiaeroairspeed(Parent, properties) [aero]'''
15+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/uiaeroairspeed.html'
16+
17+
18+
"uiaerorpm [aero]":
19+
prefix: "uiaerorpm"
20+
body: '''uiaerorpm(${1:Parent}, ${2:properties})'''
21+
description: '''uiaerorpm(Parent, properties) [aero]'''
22+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/uiaerorpm.html'
23+
24+
25+
"uiaeroclimb [aero]":
26+
prefix: "uiaeroclimb"
27+
body: '''uiaeroclimb(${1:Parent}, ${2:properties})'''
28+
description: '''uiaeroclimb(Parent, properties) [aero]'''
29+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/uiaeroclimb.html'
30+
31+
32+
"uiaeroturn [aero]":
33+
prefix: "uiaeroturn"
34+
body: '''uiaeroturn(${1:Parent}, ${2:properties})'''
35+
description: '''uiaeroturn(Parent, properties) [aero]'''
36+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/uiaeroturn.html'
37+
38+
39+
"uiaeroheading [aero]":
40+
prefix: "uiaeroheading"
41+
body: '''uiaeroheading(${1:Parent}, ${2:properties})'''
42+
description: '''uiaeroheading(Parent, properties) [aero]'''
43+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/uiaeroheading.html'
44+
45+
46+
"uiaeroegt [aero]":
47+
prefix: "uiaeroegt"
48+
body: '''uiaeroegt(${1:Parent}, ${2:properties})'''
49+
description: '''uiaeroegt(Parent, properties) [aero]'''
50+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/uiaeroegt.html'
51+
52+
53+
"uiaeroaltimeter [aero]":
54+
prefix: "uiaeroaltimeter"
55+
body: '''uiaeroaltimeter(${1:Parent}, ${2:properties})'''
56+
description: '''uiaeroaltimeter(Parent, properties) [aero]'''
57+
descriptionMoreURL: 'https://www.mathworks.com/help/aero/uiaeroaltimeter.html'
58+

snippets/coder_coder_.cson

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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.config(build_type, 'ecoder', value) [coder]'''
8+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.config.html'
9+
10+
11+
"coder.OutputType [coder]":
12+
prefix: "coder.OutputType"
13+
body: '''coder.OutputType(${1:name})'''
14+
description: '''coder.OutputType(name) [coder]'''
15+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.OutputType.html'
16+

snippets/coder_connectivity_.cson

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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: '''buildStandaloneCoderAssumptions(buildFolder) [coder]'''
8+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/buildStandaloneCoderAssumptions.html'
9+

snippets/coder_embeddedcoder_.cson

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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.dictionary.Entry.set(entryObj, pName1, pValue1) [coder]'''
8+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.dictionary.Entry.set.html'
9+
10+
11+
"coder.Dictionary.getSection [coder]":
12+
prefix: "coder.Dictionary.getSection"
13+
body: '''${1:outputValue1} = coder.Dictionary.getSection(${1:dictionaryObj}, ${2:sectionName})'''
14+
description: '''outputValue1 = coder.Dictionary.getSection(dictionaryObj, sectionName) [coder]'''
15+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.Dictionary.getSection.html'
16+
17+
18+
"coder.dictionary.Entry.get [coder]":
19+
prefix: "coder.dictionary.Entry.get"
20+
body: '''${1:outputValue1} = coder.dictionary.Entry.get(${1:entryObj}, ${2:pName1})'''
21+
description: '''outputValue1 = coder.dictionary.Entry.get(entryObj, pName1) [coder]'''
22+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.dictionary.Entry.get.html'
23+

snippets/coder_matlabcoder_.cson

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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('-toconfig', value) [coder]'''
8+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.html'
9+
10+
11+
"codegen [coder]":
12+
prefix: "codegen"
13+
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})'''
14+
description: '''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) [coder]'''
15+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/codegen.html'
16+

snippets/coder_simulinkcoder_.cson

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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: '''blockHandle = crossReleaseImport(buildFolder, configset, 'SimulationMode', value, 'DataDictionary', value, 'ConfigParams', value, 'SFunctionName', value, 'OriginalPaths', value, 'ReplacementPaths', value) [coder]'''
8+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/crossReleaseImport.html'
9+

snippets/coder_xcp_.cson

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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.xcp.a2l.addCoderXCPInfo(buildDir, 'MergeMdlRefs', value, 'SetAddress', value, 'InputFile', value, 'OutputFile', value) [coder]'''
8+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/coder.xcp.a2l.addCoderXCPInfo.html'
9+

snippets/coder_xrel_.cson

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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: '''sharedCodeUpdate(sourceFolder, destinationFolder, 'ExistingCodeSubfolder', value) [coder]'''
8+
descriptionMoreURL: 'https://www.mathworks.com/help/coder/sharedCodeUpdate.html'
9+

0 commit comments

Comments
 (0)