-
Notifications
You must be signed in to change notification settings - Fork 52
Tools and docs #79
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
Merged
Merged
Tools and docs #79
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b84dafb
Add issue template.
omniomi dd11895
build tools
omniomi 72e163d
rework tools.
omniomi 6449670
correct prereqs.
omniomi 134d785
fix npm warnings.
omniomi 9127a4a
add console logging.
omniomi 59e4782
tweak wording.
omniomi f76340a
tweak wording of readme.
omniomi 8d9889b
Trademark capitalization
omniomi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
syntaxes/ | ||
tools/node_modules/ | ||
tools/package-lock.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!-- | ||
BEFORE SUBMITTING A NEW ISSUE... | ||
|
||
Please try a different theme to make sure the problem | ||
is not with the theme and is actually with the syntax. | ||
|
||
If you are not reporting a bug please remove this template | ||
and describe the issue in your own words. | ||
--> | ||
|
||
### Environment | ||
|
||
- Editor and Version (VS Code, Atom, Sublime): | ||
- Your primary theme: | ||
|
||
### Issue Description | ||
|
||
<!-- Describe the issue in detail --> | ||
|
||
#### Screenshots | ||
|
||
<!-- If possible include screenshots of the issue --> | ||
|
||
### Expected Behavior | ||
|
||
<!-- How would you expect it to behave --> | ||
|
||
### Code Samples | ||
|
||
<!-- | ||
Include any code sippets that can be used to reproduce the | ||
described behavior. | ||
--> | ||
|
||
```PowerShell | ||
|
||
|
||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "editorsyntax", | ||
"license" : "MIT", | ||
"description": "PowerShell language syntax", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/PowerShell/EditorSyntax.git" | ||
}, | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"fast-plist": "0.1.2" | ||
}, | ||
"scripts": { | ||
"build-grammar": "node ./scripts/build-grammar.js ../PowerShellSyntax.tmLanguage ../syntaxes/powershell.tmLanguage.json" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
* | ||
* Modified for PowerShell\EditorSyntax from Microsoft\vscode (update-grammar.js) | ||
* This script generates the JSON file using the same tools as vscode's build. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
'use strict'; | ||
|
||
var path = require('path'); | ||
var fs = require('fs'); | ||
var plist = require('fast-plist'); | ||
|
||
exports.update = function (tmlPath, dest) { | ||
console.log('... Reading source file.'); | ||
var content = fs.readFileSync(tmlPath).toString(); | ||
|
||
console.log('... Parsing content.'); | ||
var grammar; | ||
grammar = plist.parse(content); | ||
|
||
console.log('... Building contents.'); | ||
let result = { | ||
information_for_contributors: [ | ||
'This file has been converted from source and may not be in line with the official build.', | ||
'The current master branch for this syntax can be found here: https://github.com/PowerShell/EditorSyntax', | ||
'If you want to provide a fix or improvement, please create a pull request against the original repository.' | ||
] | ||
}; | ||
|
||
result.version = require('child_process') | ||
.execSync('git rev-parse HEAD') | ||
.toString().trim() | ||
|
||
let keys = ['name', 'scopeName', 'comment', 'injections', 'patterns', 'repository']; | ||
for (let key of keys) { | ||
if (grammar.hasOwnProperty(key)) { | ||
result[key] = grammar[key]; | ||
} | ||
} | ||
|
||
var dirname = path.dirname(dest); | ||
if (!fs.existsSync(dirname)) { | ||
console.log('... Creating directory: ' + dirname); | ||
fs.mkdirSync(dirname); | ||
} | ||
|
||
fs.writeFileSync(dest, JSON.stringify(result, null, '\t')); | ||
console.log('[Finished] File written to: ' + dest); | ||
}; | ||
|
||
if (path.basename(process.argv[1]) === 'build-grammar.js') { | ||
console.log('[Starting] Converting ' + process.argv[2] + ' to json.'); | ||
exports.update(process.argv[2], process.argv[3]); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to register that we are using this library (internal process). I'm expecting it to be approved quickly but I wanted to let you know. It might take a day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it helps fast-plist was written by Microsoft https://github.com/Microsoft/node-fast-plist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well that makes things a lot easier