Code autocompletion in SourceCraft Code Assistant
Note
The interface language of the Visual Studio Code plugin depends on the selected IDE language.
The smart autocompletion mode explicitly supports code autocompletion for the following programming languages and frameworks:
- C++
- Go
- Java
- JavaScript/TypeScript
- Kotlin
- Python
- Scala
- SQL
- Swift
Autocompletion may also work for other languages. For languages that are less represented in public repositories, the number and quality of autocompletion prompts will be lower.
Code Assistant analyzes your code context and provides the following types of suggestions:
- Automatic.
- User-triggered (Ctrl + Space). In Visual Studio Code, you can also use Ctrl + Enter.
How to work with Code Assistant:
-
Open the IDE and create a test file named
server.cpp
with the following contents:// simple web-server to work with sockets #include <iostream> #include <string> #include <sys/socket.h> #include <netinet/in.h> #include <unistd.h> using namespace std; int main() { }
-
In the
int main()
section, start typing something, e.g.,//create socket
. See the Code Assistant suggestion:... int main() { //create socket int sockfd = socket(AF_INET, SOCK_STREAM, 0); }
-
Select an action for the suggestion:
Visual Studio CodeJetBrains IDE- Click Tab to accept the suggestion.
- To start accepting the suggestion word by word, press Ctrl + → for Windows or Linux or Command + → for macOS.
- To discard the suggestion, press Esc.
- If there are multiple suggestions, you can switch between them using Alt + [ and Alt + ] for Windows or Linux or Option + [ and Option + ] for macOS.
- Click Tab to accept the suggestion.
- To discard the suggestion, press Esc.
You can also watch our Code Assistant here video tutorial .
Suggestion indicator
When generating a suggestion, the
The suggestion indicator is enabled by default.
To enable or disable the indicator:
- Click the
- In the menu that opens, select Settings.
- In the settings window, enable or disable Enable Empty Indicator and Enable Loading Indicator.
- In the top-right corner, click
- In the left-hand column, select SourceCraft Code Assistant.
- Enable or disable Disable suggest indicator.
- Click Save to save the settings.