-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from wkillerud/feat/sassdoc-authoring
Improvements to SassDoc editing
- Loading branch information
Showing
41 changed files
with
1,020 additions
and
215 deletions.
There are no files selected for viewing
This file contains 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.15.0 |
This file contains 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 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 @@ | ||
{ | ||
"somesass.scannerDepth": 30, | ||
"somesass.scannerExclude": [ | ||
"**/.git", | ||
"**/node_modules", | ||
"**/bower_components" | ||
], | ||
"somesass.scanImportedFiles": true, | ||
"somesass.showErrors": false, | ||
"somesass.suggestAllFromOpenDocument": false, | ||
"somesass.suggestFromUseOnly": false, | ||
"somesass.suggestVariables": true, | ||
"somesass.suggestMixins": true, | ||
"somesass.suggestFunctions": true, | ||
"somesass.suggestFunctionsInStringContextAfterSymbols": " (+-*%" | ||
} |
This file contains 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 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,76 @@ | ||
# Contributing | ||
|
||
Thank you for showing an interest in contributing! | ||
|
||
Before you start, please make a new Issue. I don't always make new issues for all the things I currently work on. By making a new Issue we can hopefully avoid duplicating our efforts. | ||
|
||
If you open a pull request, please **make sure to set the correct target**. This is a fork, and GitHub defaults to using the source repository as a target for pull requests. Please don't create needless noise in the upstream repository. The correct target is `wkillerud/vscode-scss` and the branch `main`. | ||
|
||
## Development environment | ||
|
||
You will need these things installed: | ||
|
||
- Node.js | ||
- Visual Studio Code stable | ||
|
||
To get started: | ||
|
||
- Fork this repo | ||
- Clone your fork | ||
- Open your cloned repo in Visual Studio Code | ||
- Run `npm install` | ||
- Confirm existing tests are running | ||
- Run `npm test` | ||
- Then run `npm run test:e2e`. This downloads VS Code Insiders and runs integration tests. | ||
- Finally, run `npm run dev`, or the Run Build Task command in Visual Studio Code | ||
|
||
Changes should now build automatically. | ||
|
||
To test your changes: | ||
|
||
- Go to the Run and Debug section | ||
- Run the Launch Client configuration | ||
|
||
A new window should open with the title `[Extension Development Host]`. In this window you can open whatever project you want to use for testing. If you don't have one you can open the folder `fixtures/e2e/` in this repo. | ||
|
||
Every time you make a change you should restart the Launch Client task. | ||
|
||
Test your changes and see if they work. If they don't, it's time to do some debugging. | ||
|
||
## Debugging | ||
|
||
Changes often don't work on the first try. To get a better idea of what's happening, let's debug the _server_ portion of the extension. | ||
|
||
In this extension there is a client part and a server part, and most of the work happens in the server part. | ||
|
||
In the Run and Debug section you should find an Attach to Server configuration. Run that. You should end up with a badge showing the number 2 on the Run and Debug section. | ||
|
||
Now you can set breakpoints to inspect what is really happening in your code. Unfortunately, at time of writing you must set these breakpoints in the _compiled output_ in `dist/unsafe/server.js`. | ||
|
||
Open `dist/unsafe/server.js`, search for a function name close to where you want to debug, and place breakpoints where you would like. Then test your changes in the Extension Development Host again. Hopefully you should see the code pause on your breakpoint. If not, confirm the Attach to Server task is running, or try to place breakpoints elsewhere. Something unexpected may stop you from reaching your code. | ||
|
||
### Debugging unit tests | ||
|
||
Unit tests can be useful tools to debug more efficiently. If you want to debug using a unit test, the same rule applies – you have to set breakpoints on the compiled output. | ||
|
||
Tests are compiled to `out/unsafe/test/`. Find your test, or the code you want to debug in the `out/unsafe/` folder, and set breakpoints. | ||
|
||
The extension Mocha Test Explorer (`hbenl.vscode-mocha-test-adapter`) is useful to launch individual tests in debug mode. Install the extension, open your unit test, and press the Debug button that should appear over your test. Hopefully you should see the code pause on your breakpoint. If not, try to place breakpoints elsewhere. Something unexpected may stop you from reaching your code. | ||
|
||
### Debugging integration tests | ||
|
||
Integration tests run in the Extension Development Host, and are more realistic than unit tests. However, sometimes they can be tricky to write. You can debug the tests temselves if you'd like. | ||
|
||
This method of debugging is **not recommended** if you want to debug the functionality itself. Instead, debug using the Client + Server configuration explained above, and perform the test manually. | ||
|
||
If you still want to debug the integration tests there are a few things to keep in mind, since tests run in this way use your main stable install of VS Code (not Insiders, like from the terminal): | ||
|
||
- You will need to install Vetur (`octref.vetur`) and Svelte for VS Code (`svelte.svelte-vscode`) | ||
- You **must** use default settings for Some Sass. Tip: use the included Workspace Settings. | ||
- To compile changes in test code, run `npm run test:compile` | ||
|
||
Again, breakpoints must be set in the compiled output. Integration tests are compiled to `out/unsafe/test/e2e/suite/`. Breakpoints can _only be set in test code_, meaning any code in the `out/unsafe/test/e2e/` folder. | ||
|
||
Now you are ready to start debugging! | ||
|
||
Breakpoints set, go to the Run and Debug and run the Integration Tests configuration. Hopefully you should see the code pause on your breakpoint. If not, try to place breakpoints elsewhere. Something unexpected may stop you from reaching your code. |
This file contains 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 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 @@ | ||
{ | ||
"somesass.scannerDepth": 30, | ||
"somesass.scannerExclude": [ | ||
"**/.git", | ||
"**/node_modules", | ||
"**/bower_components" | ||
], | ||
"somesass.scanImportedFiles": true, | ||
"somesass.showErrors": false, | ||
"somesass.suggestAllFromOpenDocument": false, | ||
"somesass.suggestFromUseOnly": false, | ||
"somesass.suggestVariables": true, | ||
"somesass.suggestMixins": true, | ||
"somesass.suggestFunctions": true, | ||
"somesass.suggestFunctionsInStringContextAfterSymbols": " (+-*%" | ||
} |
This file contains 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 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 |
---|---|---|
|
@@ -28,4 +28,11 @@ $fonts: -apple-system; | |
color: $; | ||
} | ||
@use '../namespace' as ns; | ||
.foo { | ||
color: ns. | ||
@include ns. | ||
} | ||
</style> |
This file contains 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 |
---|---|---|
|
@@ -16,3 +16,10 @@ $fonts: -apple-system; | |
.foo { | ||
color: $; | ||
} | ||
|
||
@use '../namespace' as ns; | ||
|
||
.foo { | ||
color: ns. | ||
@include ns. | ||
} |
This file contains 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,36 @@ | ||
@use "sass:math"; | ||
|
||
/// | ||
@mixin contentless { | ||
color: limegreen; | ||
} | ||
|
||
/// | ||
@mixin has-content { | ||
@content; | ||
} | ||
|
||
/// | ||
@mixin has-parameters($a: 1px, $b: 2px) { | ||
font-size: math.calc($a + $b); | ||
} | ||
|
||
/// | ||
@mixin has-parameters-and-content($a, $b) { | ||
@media screen and (min-width: $a) and (max-width: #{$b - 1px}) { | ||
@content; | ||
} | ||
} | ||
|
||
/// | ||
@function parameterless() { | ||
@return 1px; | ||
} | ||
|
||
/// | ||
@function parameterfull($a: 1px, $b: 2px) { | ||
@return math.calc($a + $b); | ||
} | ||
|
||
/// | ||
$doc-variable: 1px; |
This file contains 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 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 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 |
---|---|---|
|
@@ -7,3 +7,10 @@ | |
|
||
@include mixin(); | ||
} | ||
|
||
@use '../namespace' as ns; | ||
|
||
.foo { | ||
color: ns.$var-var-variable; | ||
@include ns.mix-mix-mixin; | ||
} |
This file contains 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 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 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 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
Oops, something went wrong.