Repository navigation
Add vscode style ".acode" folder and file structure for settings and extensions. - #3093
codewithchai0605 wants to merge 4 commits into
Conversation
- Implement tests for workspaceExtensions including validation of plugin IDs, parsing of extension recommendations, and handling of hostile input. - Introduce tests for workspaceSettings covering project settings allowlist, parsing of project settings, and validation of individual settings like tabSize and formatOnSave. - Ensure both test files check for frozen results and handle edge cases such as invalid JSON and prototype pollution.
[Medium impact] The changes affect settings and plugin-review behavior only for projects with a configured `.acode` folder. Fix Android folder matching and saved editor options before merging. FindingsSummaryAdds project configuration through
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Open folder] --> B[Scan .acode]
C[Save or change configuration files] --> B
B --> D[Read settings.json]
B --> E[Read extensions.json]
D --> F[Apply project editor options]
D --> G[Resolve formatting settings]
E --> H[Check installed plugins]
H --> I[Show recommendations]
I --> J[User opens plugin search]
Reviews (6) · Last reviewed commit: "Fix execOperation to call workspace.path..." · Reviewed by Greptile |
1 similar comment
c296faf to
2c2742c
Compare
| if (!url) return null; | ||
| let match = null; | ||
| for (const workspace of workspaces.values()) { | ||
| if (!Url.isSameOrDescendant(url, workspace.url)) continue; |
There was a problem hiding this comment.
Android folders miss project settings
A folder added through Android's storage picker can have a bare content://…/tree/… root URL, while its files use content://…/tree/…::primary:…/file.js URLs. Url.isSameOrDescendant requires / after the root, so find rejects those files. The project is detected, but its indentation and format-on-save settings never apply.
Normalize both URLs to the same document-path form before comparing them.
Knowledge Base Used: Filesystem and project access
| for (const pane of panes) { | ||
| const file = pane.activeFile; | ||
| if (!pane.editor || file?.type !== "editor") continue; | ||
| applyOptions(PROJECT_SETTING_KEYS, pane.editor, file); |
There was a problem hiding this comment.
reapplyProjectOptions changes the editor state without updating file.__cmOptionsSignature. Start with project tabSize: 4, change it to 8 while the file is visible, then switch away. If the project returns to 4 while the file is hidden, reopening it restores the state with 8. Its saved signature still says 4, so applyCurrentEditorOptions skips the update and new edits use the wrong indentation.
Update the saved signature when applying project options, or invalidate it so activation reapplies the current settings.
Knowledge Base Used: Workspace and code editor
Plugin recommendations.
A project can suggest plugins that suits it. This is only ever a suggestion nothing here installs, enables or runs anything.
it can be used like this, Plugin recommendations: the contents of
.acode/extensions.json{ "recommendations": ["acode.plugin.example"] }Note: This requires the backend to update the existing search api to also accepts query like "id:plugin.id" like "mode:pluginId".
Project settings:
It allows to change the project level settings without editing their globals settings.
This feature is not implemented completely. It can be improved much.