Skip to content

Commit 5c103fc

Browse files
authored
Merge pull request #84 from jpogran/language-server-feature
Language server feature
2 parents e2f38d5 + 0fb3e6f commit 5c103fc

File tree

102 files changed

+9406
-511
lines changed

Some content is hidden

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

102 files changed

+9406
-511
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.travis.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
language: node_js
2+
node_js:
3+
- "node"
4+
5+
environment:
6+
ELECTRON_RUN_AS_NODE: 1
7+
VSCODE_BUILD_VERBOSE: true
8+
9+
sudo: false
10+
11+
os:
12+
- linux
13+
14+
addons:
15+
apt:
16+
sources:
17+
- ubuntu-toolchain-r-test
18+
packages:
19+
- gcc-4.9
20+
- g++-4.9
21+
- gcc-4.9-multilib
22+
- g++-4.9-multilib
23+
- zip
24+
- libgtk2.0-0
25+
- libx11-dev
26+
- libxkbfile-dev
27+
28+
before_install:
29+
- if [ $TRAVIS_OS_NAME == "linux" ]; then
30+
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
31+
sh -e /etc/init.d/xvfb start;
32+
sleep 3;
33+
fi
34+
35+
install:
36+
- cd client
37+
- npm install
38+
- npm install gulp
39+
- npm run vscode:prepublish
40+
41+
script:
42+
- npm test --silent
43+
- gulp build

CHANGELOG.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
11
# Change Log
2-
All notable changes to the "vscode-puppet" extension will be documented in this file.
32

4-
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
5-
6-
## [Unreleased]
7-
- Initial release
8-
9-
10-
## [0.0.1] - 2017-04-10
11-
## Added
12-
- Initial release of the puppet extension.
13-
14-
## [0.0.2] - 2017-05-04
15-
## Added
16-
- Puppet Resource and Puppet Module commands.
17-
18-
## [0.0.3] - 2017-05-08
19-
## Added
20-
- Puppet Parser validate linter added
3+
All change information is kept in [client/CHANGELOG.md](client/CHANGELOG.md)

README.md

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,58 @@
1-
# puppet-vscode
1+
<!--
2+
TODO: Need correct marketplace ID
3+
[![Version](https://vsmarketplacebadge.apphb.com/version/jpogran.Puppet.svg)](https://marketplace.visualstudio.com/items?itemName=jpogran.Puppet)
4+
[![Installs](https://vsmarketplacebadge.apphb.com/installs-short/jpogran.Puppet.svg)](https://marketplace.visualstudio.com/items?itemName=jpogran.Puppet)
5+
-->
26

3-
## Features
7+
# Puppet Language Support for Visual Studio Code
48

5-
## Syntax Highlighting
9+
This extension provides Puppet Language support for [Visual Studio Code](https://code.visualstudio.com/)
610

7-
- Puppet DSL
8-
- Puppet grammar
11+
The extension is composed of the VS Code Extension in the [`client/`](client) directory and the Puppet Language Server in the [`server/`](server) directory
912

10-
\!\[syntax\]\(images/syntax.png\)
1113

12-
## Snippet support
14+
## How to run the client and server for development
1315

14-
\!\[feature X\]\(images/snippets.png\)
16+
### Run the language server
1517

16-
## Puppet Linting support
18+
Follow the instructions in the server documentation - [How to run the Language Server for Develoment](server/READMEmd#How_to_run_the_Language_Server_for_Development). Ensure you use the `--timeout=0` and `--no-stop` arguments so the server does not stop.
1719

18-
On document save, puppet-lint will be run on the open file.
20+
### Run the client
1921

20-
\!\[feature X\]\(images/puppet-lint.png\)
22+
* Ensure nodejs is installed
2123

22-
## Requirements
24+
* Clone this repository
2325

24-
- puppet-lint installed and available on the PATH or path to binary set in extension settings.
26+
```
27+
> git clone https://github.com/jpogran/puppet-vscode.git
2528
26-
## Extension Settings
29+
> cd puppet-vscode
30+
> cd client
31+
```
2732

28-
This extension contributes the following settings:
33+
* Install the node modules and start VS Code
2934

30-
* `puppetLint.enable`: enable/disable this extension
31-
* `puppetLint.path`: set to the path to puppet-lint
35+
```
36+
> npm install
37+
...
3238
33-
## Known Issues
39+
> [email protected] postinstall C:\Source\puppet-vscode\client
40+
> node ./node_modules/vscode/bin/install
3441
35-
None yet.
42+
Detected VS Code engine version: ^1.10.0
43+
Found minimal version that qualifies engine range: 1.10.0
44+
Fetching vscode.d.ts from: https://raw.githubusercontent.com/Microsoft/vscode/1.10.0/src/vs/vscode.d.ts
45+
vscode.d.ts successfully installed!
3646
37-
## Release Notes
47+
> code .
48+
```
3849

39-
**Note** Not released yet. WIP
50+
* Once VS Code is running, press `F5` to start a build and a new VS Code development instance should start
4051

41-
- syntax
42-
- grammar
43-
- linter
52+
* Open a Puppet file (.pp) and the client will start and connect to the Puppet Server
4453

45-
### 0.0.1
54+
> Other Puppet VS Code extensions may cause issues with the development instance. Ensure that you either uninstall or disable the other Puppet extensions prior.
4655
47-
Initial release of the puppet extension.
56+
## Issues
4857

49-
### 0.0.2
50-
51-
Puppet Resource and Puppet Module commands.
52-
53-
### 0.0.3
54-
55-
Puppet Parser validate linter added
58+
Please raise issues for the Language Server or Extension using the GitHub issue tracker.

appveyor.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
version: 0.0.4-appv.{build}
2+
branches:
3+
only:
4+
- add-travis-appveyor
5+
- language-server-feature
6+
clone_depth: 10
7+
init:
8+
- SET
9+
10+
environment:
11+
matrix:
12+
# Language Server testing
13+
# LTS Agent
14+
- PUPPET_GEM_VERSION: "~> 4.7.0"
15+
RUBY_VER: 21-x64
16+
RAKE_TASK: test
17+
# Latest 4.x branch
18+
- PUPPET_GEM_VERSION: "~> 4.0"
19+
RUBY_VER: 21-x64
20+
RAKE_TASK: test
21+
# Latest Puppet
22+
- PUPPET_GEM_VERSION: "> 4.0.0"
23+
RUBY_VER: 23-x64
24+
RAKE_TASK: test
25+
# Ruby style
26+
- PUPPET_GEM_VERSION: "> 4.0.0"
27+
RUBY_VER: 23-x64
28+
RAKE_TASK: rubocop
29+
30+
# Extension testing
31+
# Package it up to a VSIX
32+
- nodejs_version: "7.4.0"
33+
nodejs_arch: "x64"
34+
GULP_BUILD_TASK: build
35+
36+
matrix:
37+
fast_finish: true
38+
allow_failures:
39+
# Ruby style
40+
- PUPPET_GEM_VERSION: "> 4.0.0"
41+
RUBY_VER: 23-x64
42+
RAKE_TASK: rubocop
43+
44+
install:
45+
- ps: |
46+
Write-Host "Setting build version..."
47+
$ENV:APPVEYOR_BUILD_VERSION | Out-File -FilePath 'server\lib\puppet-languageserver\VERSION' -Encoding ASCII -Confirm:$false -Force
48+
49+
if ($ENV:RUBY_VER -ne $null) {
50+
Set-Location -Path ".\server"
51+
$ENV:Path = 'C:\Ruby' + $ENV:RUBY_VER + '\bin;' + $ENV:Path
52+
53+
Write-Host "Ruby Version..."
54+
& ruby -v
55+
Write-Host "Gem Version..."
56+
& gem -v
57+
Write-Host "Bundle Version..."
58+
& bundle -v
59+
& bundle install
60+
61+
type Gemfile.lock
62+
}
63+
64+
if ($ENV:nodejs_version -ne $null) {
65+
Install-Product node $env:nodejs_version $env:nodejs_arch
66+
Set-Location -Path ".\client"
67+
68+
Write-Host "Node Version..."
69+
& node --version
70+
71+
Write-Host "Updating npm..."
72+
& npm install -g npm@4 --silent
73+
74+
Write-Host "npm Version..."
75+
& npm --version
76+
77+
Write-Host "Installing modules..."
78+
& npm install --silent
79+
80+
Write-Host "Set the package.json version..."
81+
& node node_modules\gulp\bin\gulp.js bump --version $ENV:APPVEYOR_BUILD_VERSION
82+
}
83+
84+
build_script:
85+
- cmd: IF NOT [%GULP_BUILD_TASK%] == [] node node_modules\gulp\bin\gulp.js %GULP_BUILD_TASK%
86+
87+
test_script:
88+
- cmd: IF NOT [%RAKE_TASK%] == [] bundle exec rake %RAKE_TASK%
89+
- cmd: IF NOT [%NPM_TASK%] == [] npm run %NPM_TASK%
90+
- cmd: IF NOT [%GULP_TASK%] == [] node node_modules\gulp\bin\gulp.js %GULP_TASK%
91+
92+
artifacts:
93+
- path: client/*.vsix

client/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
out/
2+
node_modules/
3+
vendor/
4+
tmp/
5+
6+
// Ignore generated module output
7+
*.vsix

client/.vscode/tasks.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
// ${fileExtname}: the current opened file's extension
77
// ${cwd}: the current working directory of the spawned process
88

9-
// A task runner that calls a custom npm script that compiles the extension.
109
{
11-
"version": "0.1.0",
12-
13-
// we want to run npm
14-
"command": "npm",
15-
16-
// the command is a shell script
17-
"isShellCommand": true,
18-
19-
// show the output window only if unrecognized errors occur.
20-
"showOutput": "silent",
21-
22-
// we run the custom script "compile" as defined in package.json
23-
"args": ["run", "compile", "--loglevel", "silent"],
24-
25-
// The tsc compiler is started in watching mode
26-
"isWatching": true,
27-
28-
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
29-
"problemMatcher": "$tsc-watch"
30-
}
10+
"version": "2.0.0",
11+
"tasks": [
12+
{
13+
"taskName": "npm",
14+
"command": "npm",
15+
"isShellCommand":true,
16+
"showOutput": "silent",
17+
"args": ["run", "compile-watch"],
18+
"isBackground": true,
19+
"problemMatcher": "$tsc-watch"
20+
},
21+
{
22+
"taskName": "gulp",
23+
"command": "gulp",
24+
"isBuildCommand": true,
25+
"showOutput": "always",
26+
"isBackground": true,
27+
"suppressTaskName": true
28+
}
29+
]
30+
}

client/.vscodeignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ src/**
66
**/*.map
77
.gitignore
88
tsconfig.json
9-
vsc-extension-quickstart.md
9+
tmp/**
10+
logs/**
11+
sessions/**
12+
gulpfile.js

client/CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Change Log
2+
All notable changes to the "vscode-puppet" extension will be documented in this file.
3+
4+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
5+
6+
## [Unreleased]
7+
- Initial release
8+
9+
10+
## [0.0.1] - 2017-04-10
11+
## Added
12+
- Initial release of the puppet extension.
13+
14+
## [0.0.2] - 2017-05-04
15+
## Added
16+
- Puppet Resource and Puppet Module commands.
17+
18+
## [0.0.3] - 2017-05-08
19+
## Added
20+
- Puppet Parser validate linter added

0 commit comments

Comments
 (0)