Conversation
✅ Deploy Preview for sass-lang ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
@nex3 I have a few options for getting the current list of module functions and variables. Essentially, I'm able to generate a list of the values using Sass,
Do you have any preference on this, or other ideas? I didn't see a clear way of parsing this from the existing documentation. |
|
Can you pass the result of |
That worked well! |
| } | ||
|
|
||
| type CompletionInfo = { | ||
| name: string; |
| } | ||
| `; | ||
|
|
||
| const modMap: ModuleDefinition[] = []; |
There was a problem hiding this comment.
Would it be cleaner to make this a Record<string, ModuleDefinition> with the module names as keys? Then instead of some Array.prototype.reduce stuff, you could use a simpler mapRecord<I, O>(record: Record<T, I>, mapper: (I) => O): Record<T, O> utility function.
There was a problem hiding this comment.
Potentially it could be cleaner in the cases where I'm reducing things into Record<ModuleName, CompletionSource>, but the metadata is being used in other ways as well. I'm generally a fan of keeping data in flat arrays of objects, as it tends to be the most versatile.
| }; | ||
| } | ||
|
|
||
| const moduleVariableCompletions = Object.freeze( |
There was a problem hiding this comment.
Probably for a follow-up PR, but it's worth thinking about ways to extract the documentation for variables and functions from source/documentation/modules/*.md so we can include them in these autocompletions.
* main: (23 commits) [Playground] Click to Copy (sass#1177) Cut a release for a new Dart Sass version [Playground] Debug links (sass#1179) Add breaking change page for legacy-js-api (sass#1193) [Playground] Autocomplete (sass#1166) Add a breaking change page for color functions (sass#1192) Remove nonexisting `color.saturate()` function (sass#1190) Fix unprefixed `color.adjust()` name (sass#1188) Sort color functions alphabetically (sass#1187) Document color migrator (sass#1186) Cut a release for a new Dart Sass version Document new color spaces (sass#1055) (sass#1115) Cut a release for a new Dart Sass version Bump date-fns from 3.6.0 to 4.0.0 (sass#1181) Bump rollup from 4.21.2 to 4.21.3 (sass#1182) Bump @codemirror/autocomplete from 6.18.0 to 6.18.1 (sass#1183) Bump @typescript-eslint/eslint-plugin from 8.5.0 to 8.6.0 (sass#1185) Bump markdown-it-anchor from 9.1.0 to 9.2.0 (sass#1184) Fix footer not showing the latest versions. (sass#1178) [Playground] Code links (sass#1167) ...
Adds Sass-specific autocomplete to the Playground, specifically-
@codemirror/lang-csspackage in https://github.com/codemirror/lang-css/releases/tag/6.3.0 via Bump @codemirror/lang-css from 6.2.1 to 6.3.0 #1172, not here)@use "sass:math", for instancemathmath.$pimath.clamp