Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Snippets and file icon for carbon and microsoft C/C configurations #4373

Closed
wants to merge 15 commits into from

Conversation

BhJaipal
Copy link

@BhJaipal BhJaipal commented Oct 4, 2024

Adds User Snippets and file icon for VSCode and C/C configuration for microsoft C/C intellisence

@github-actions github-actions bot added the utilities Utilities for working with Carbon code: syntax highlighting, editor plugins, etc. label Oct 4, 2024
@github-actions github-actions bot requested a review from jonmeow October 4, 2024 19:36
utils/vscode/carbon.code-snippets Outdated Show resolved Hide resolved
utils/vscode/carbon.code-snippets Outdated Show resolved Hide resolved
utils/vscode/carbon.code-snippets Outdated Show resolved Hide resolved
utils/vscode/carbon.code-snippets Outdated Show resolved Hide resolved
utils/vscode/carbon.code-snippets Outdated Show resolved Hide resolved
utils/vscode/favicon.png Outdated Show resolved Hide resolved
utils/vscode/package.json Show resolved Hide resolved
utils/vscode/package.json Outdated Show resolved Hide resolved
@BhJaipal
Copy link
Author

BhJaipal commented Oct 5, 2024

@geoffromer Can you review this latest commit?

@BhJaipal
Copy link
Author

BhJaipal commented Oct 6, 2024

@jonmeow please review

utils/nvim/setup.sh Show resolved Hide resolved
@@ -2,54 2,67 @@
"package": {
"scope": "carbon",
"prefix": "package",
"body": "package $fileNameWithoutExt",
"body": "impl library ${1:$fileNameWithoutExt}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should still have package, especially since that's the name and the prefix for the snippet; we just shouldn't provide a default. We could always have a separate library snippet for the case where the user doesn't want to specify a package.

It's probably also better to leave out impl, because every library has an API file but not every library has an impl file, so leaving it out will be the right guess slightly more often. It would be ideal if we could infer this from the filename (impl files should always have a .impl.carbon extension), but I don't know if that's feasible.

Finally, the library name should have quotes around it.

Suggested change
"body": "impl library ${1:$fileNameWithoutExt}",
"body": "package $1 library \"${2:$fileNameWithoutExt}\"",

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will do it

utils/vscode/carbon.code-snippets Show resolved Hide resolved
utils/vscode/package.json Show resolved Hide resolved
utils/vscode/package.json Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right. At least judging from this doc, the convention is that src contains the source code for the extension, and then the contents of dist are generated from the source code as part of bundling. As such, I'm not sure dist/extension.js should even be checked in to source control, but in any event we certainly shouldn't be removing src/extension.js.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think TypeScript would be much helpful and better for creating extension and later we can compile it to js and create vsix package

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this file?

utils/vscode/carbon.code-snippets Show resolved Hide resolved
utils/vscode/carbon.code-snippets Show resolved Hide resolved
utils/vscode/carbon.code-snippets Show resolved Hide resolved
utils/vscode/carbon.code-snippets Show resolved Hide resolved
utils/vscode/carbon.code-snippets Show resolved Hide resolved
utils/vscode/carbon.code-snippets Show resolved Hide resolved
utils/vscode/carbon.code-snippets Show resolved Hide resolved
@BhJaipal BhJaipal closed this by deleting the head repository Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
utilities Utilities for working with Carbon code: syntax highlighting, editor plugins, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants