Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Feature] Add a small code snippet before every problem solutions#972

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Wang-Ji20 wants to merge3 commits intoLeetCode-OpenSource:master
base:master
Choose a base branch
Loading
fromWang-Ji20:master

Conversation

Wang-Ji20
Copy link

About

Code preamble is a short code snippet adding to the beginning of the program. A typical one is:

 #include<iostream>usingnamespacestd;

This feature is useful. Maybe inserting header files is interesting for the first several times, it is dreadful if we need to add tons of it each time we do the problems, especially for a dreadful language like C/C++

Configuration

To add a preamble for one language, you can follow this schema:

 "leetcode.language.preamble" = {      "cpp" : "#include <iostream>\n", }

Effect

Now you don't need to#include <iostream> everytime if you use cpp.

liuzhaoze reacted with rocket emoji
@HopoZ
Copy link

where add this schema,pls?

@Wang-Ji20
Copy link
Author

where add this schema,pls?

just in preference.. You can find a setting called "leetcode.language.preamble". Then you can edit the setting in vscode.

This is only a small utility, not very complete and did not expect it to work for everyone.

@HopoZ
Copy link

where add this schema,pls?

just in preference.. You can find a setting called "leetcode.language.preamble". Then you can edit the setting in vscode.

This is only a small utility, not very complete and did not expect it to work for everyone.

I found a more useful method,#469 (comment)

@Wang-Ji20
Copy link
Author

where add this schema,pls?

just in preference.. You can find a setting called "leetcode.language.preamble". Then you can edit the setting in vscode.
This is only a small utility, not very complete and did not expect it to work for everyone.

I found a more useful method,#469 (comment)

Thanks! So the cli provide this functionality, but the editor extension did not support it. no wonder I can't find relating configuration in the extension.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Wang-Ji20@HopoZ

[8]ページ先頭

©2009-2025 Movatter.jp