|
1 | | -# Soplang for VS Code |
| 1 | +# Soplang for Visual Studio Code |
2 | 2 |
|
3 | | - |
| 3 | +Editor tools for the implemented Soplang 3 language. `.sop` is recommended; |
| 4 | +`.so` remains associated for existing source files. Change the language mode |
| 5 | +when opening a binary shared library with that extension. |
4 | 6 |
|
5 | | -VS Code language support for [Soplang](https://github.com/soplang/soplang), a programming language designed for Somali speakers. |
| 7 | +The extension bundles a native Rust analysis server with a pinned compiler |
| 8 | +frontend. Analysis uses unsaved buffers and imports without running source, |
| 9 | +reading interactive input, compiling native code, or invoking LLVM. |
6 | 10 |
|
7 | | -## Features |
| 11 | +Available tools include syntax highlighting, canonical snippets, compiler |
| 12 | +frontend diagnostics, visible-symbol and typed-receiver completion, English |
| 13 | +hover documentation, signature help, definitions, references, symbols, |
| 14 | +highlights, conservative rename, folding, selection ranges, import links, |
| 15 | +semantic highlighting, and indentation formatting. |
8 | 16 |
|
9 | | -This extension provides comprehensive language support for Soplang in Visual Studio Code: |
| 17 | +Run, Build, Open REPL, Stop, Compiler Status, and Restart Language Server are |
| 18 | +available in the command palette. Run also works from Explorer and the editor |
| 19 | +context menu. `Ctrl+Shift+R` (`Cmd+Shift+R` on macOS) runs the selected file. |
| 20 | +Compiler tasks have interactive terminals and use executable/argument arrays. |
10 | 21 |
|
11 | | -- **Syntax Highlighting**: Full syntax highlighting for Soplang keywords, strings, comments, and operators |
12 | | -- **Code Execution**: Run Soplang files directly from VS Code |
13 | | -- **Formatting**: Automatic code formatting for Soplang files |
14 | | -- **Hover Information**: Documentation for Soplang keywords when hovering |
15 | | -- **Spell Checking**: Integration with Code Spell Checker for Soplang keywords |
16 | | -- **Snippets**: Common code snippets for faster development |
17 | | -- **Error Detection**: (Optional) Diagnostics for common syntax errors |
18 | | - |
19 | | -## Installation |
20 | | - |
21 | | -1. Open VS Code |
22 | | -2. Go to Extensions (Ctrl+Shift+X) |
23 | | -3. Search for "Soplang" |
24 | | -4. Click Install |
25 | | - |
26 | | -## Running Soplang Files |
27 | | - |
28 | | -You can run Soplang files (`.sop` or `.so` extensions) in multiple ways: |
29 | | - |
30 | | -- **Context Menu**: Right-click on a file and select "Run Soplang File" |
31 | | -- **Keyboard Shortcut**: Press `Ctrl+Shift+R` (or `Cmd+Shift+R` on Mac) |
32 | | -- **Command Palette**: Press `Ctrl+Shift+P` and type "Run Soplang File" |
33 | | -- **Editor Title**: Click the Soplang icon in the top-right of the editor |
34 | | - |
35 | | -The file will be automatically saved before running. |
36 | | - |
37 | | -## Configuration |
38 | | - |
39 | | -This extension provides several configuration options: |
40 | | - |
41 | | -### Error Detection |
42 | | - |
43 | | -By default, error detection is disabled. To enable it: |
44 | | - |
45 | | -1. Open Settings (`Ctrl+,`) |
46 | | -2. Search for "soplang" |
47 | | -3. Check the "Enable Diagnostics" option |
| 22 | +Install a real Soplang 3 compiler on the extension host for execution. Set |
| 23 | +`soplang.compilerPath` to its executable path if it is absent from `PATH`. |
| 24 | +The extension does not install a compiler. Standalone builds also need the |
| 25 | +compiler's clang, rustc, and matching Soplang runtime libraries. A source debugger |
| 26 | +requires compiler debug information and a debug adapter; neither is included. |
48 | 27 |
|
49 | 28 | ```json |
50 | | -"soplang.enableDiagnostics": true |
51 | | -``` |
52 | | - |
53 | | -### Formatting |
54 | | - |
55 | | -Automatic formatting on save is enabled by default for Soplang files. You can disable it in the settings: |
56 | | - |
57 | | -```json |
58 | | -"[soplang]": { |
59 | | - "editor.formatOnSave": false |
| 29 | +{ |
| 30 | + "soplang.compilerPath": "soplang", |
| 31 | + "soplang.enableDiagnostics": true, |
| 32 | + "soplang.strict": false, |
| 33 | + "soplang.build.optimization": 2, |
| 34 | + "soplang.build.output": "", |
| 35 | + "soplang.workingDirectory": "" |
60 | 36 | } |
61 | 37 | ``` |
62 | 38 |
|
63 | | -## Language Features |
64 | | - |
65 | | -### Syntax Highlighting |
66 | | - |
67 | | -All Soplang keywords are properly highlighted: |
68 | | - |
69 | | -- `door` - Variable declaration |
70 | | -- `hawl` - Function declaration |
71 | | -- `qor` - Print statement |
72 | | -- `gelin` - Read input |
73 | | -- `haddii`, `haddii_kale`, `ugudambeyn` - Conditionals |
74 | | -- `kuceli`, `intay` - Loops |
75 | | -- ...and many more |
76 | | - |
77 | | -### Hover Documentation |
78 | | - |
79 | | -Hover over any Soplang keyword to see documentation, examples, and usage tips. |
80 | | - |
81 | | -### Code Snippets |
82 | | - |
83 | | -Type these prefixes and press Tab to use code snippets: |
84 | | - |
85 | | -- `door` - Variable declaration |
86 | | -- `hawl` - Function declaration |
87 | | -- `if` - If statement |
88 | | -- `for` - For loop |
89 | | -- `while` - While loop |
90 | | - |
91 | | -## Requirements |
92 | | - |
93 | | -- Visual Studio Code v1.95.0 or higher |
94 | | -- The [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) extension (automatically installed) |
95 | | - |
96 | | -## Troubleshooting |
97 | | - |
98 | | -### Soplang files not running |
99 | | - |
100 | | -Make sure the `soplang` command is available in your PATH. If not, you can install it by following the instructions at [Soplang GitHub repository](https://github.com/soplang/soplang). |
101 | | - |
102 | | -### Syntax highlighting not working |
103 | | - |
104 | | -If syntax highlighting is not working, try: |
105 | | - |
106 | | -1. Reload VS Code window (Ctrl+Shift+P > "Reload Window") |
107 | | -2. Ensure the file has `.sop` or `.so` extension |
108 | | - |
109 | | -## Contributing |
110 | | - |
111 | | -The source code for this extension is available on [GitHub](https://github.com/soplang/vsCodeLanguageSupport). Contributions are welcome! |
112 | | - |
113 | | -## License |
114 | | - |
115 | | -This extension is licensed under the [MIT License](LICENSE). |
| 39 | +The default working directory is the selected file's workspace folder, or its |
| 40 | +source directory outside a workspace. Relative configuration paths use that |
| 41 | +working directory. Save cancellation or failure prevents execution. Workspace |
| 42 | +Trust is required for compiler tasks and custom server executables. Bundled |
| 43 | +analysis works in restricted mode, with disk imports restricted to workspace |
| 44 | +roots. Execution and analysis run on the workspace extension host, including |
| 45 | +SSH, WSL, and containers when a matching native server is present. |
| 46 | + |
| 47 | +No settings are changed when the extension activates. Formatting on save is |
| 48 | +opt-in. The formatter changes leading indentation only, preserves strings, |
| 49 | +comments, operators and EOLs, and returns no edits for malformed source. Range |
| 50 | +formatting touches only indentation wholly inside the selected range. |
| 51 | + |
| 52 | +Code Spell Checker is optional. The contributed `soplang` dictionary can be |
| 53 | +enabled through its language settings; no global spelling settings are changed. |
| 54 | + |
| 55 | +See [the support matrix](docs/SUPPORT.md) for verification status and limits, |
| 56 | +[the language catalog](keywords.md) for signatures and contracts, and |
| 57 | +[development instructions](docs/DEVELOPMENT.md) for builds and tests. |
0 commit comments