VnPy - Does VnTrader has an English version? - chinese-locale

I just cloned and run VnTrader on my Ubuntu 16-04 machine. The application is in Chinese and I can't find a way to change the language. How can I change the language of VnTrader to English?

VnTrader has an English Version, to change it you need to hard-code the language you want into the file examples/VT_setting.json
{
"fontFamily": "微软雅黑",
...
"language": "english",
...
"maxDecimal": 4
}

Related

How to add a new match/mapping for an existing language?

Thanks to an extension (Caddyfile Syntax, Caddyfile Support) I have highlighting for Caddyfile. Installing the extensions also mapped Caddyfile files with the relevant syntax highlighting rules.
I now would like to also have the same mapping for caddy.conf files.
According to the documentation, I should add an alias for caddy.conf so that it is handled the same way as Caddyfile.
The problem is that I do not know where to add this information in settings.json.
I had a look for anything "caddy" in defaultSettings.json but I do not see any structure that would match th eone in the documentation. Namely, I only see
// Configure settings to be overridden for the caddyfile language.
"[caddyfile]": {
"editor.insertSpaces": false,
"editor.formatOnSave": true
},
What I am looking for should more look like (according to the documentation above)
"languages": [{
"id": "java",
"extensions": [ ".java", ".jav" ],
"aliases": [ "Java", "java" ]
}]
So in practical terms - where in setting.json should I add the alias (or possibly a new mapping)?
Try adding this to your settings.json:
"files.associations": {
"*.conf": "caddyfile"
}
Alternatively, you can invoke the workbench.action.editor.changeLanguageMode command (Ctrl+K M by default, also works by clicking the language label in the status bar) and select the language you want. This is probably preferable if you might have files with the same extension, but different syntax.

How to show spellchecker(wrong spelling with underline) in TextFormField in Flutter?

In my application I have a story line - Forgive user typos in search makes it effortless for the users. So what exactly I want when I type something in TextFormField it should do spellchecker. Is there is any solution for that in flutter? Kindly find the attached screenshot.
You should use a spellcheck api service for this like Bing Spell Check API it will return the mistakes in the text and you can underline them. Here is the respond of your text;
{
"_type": "SpellCheck",
"flaggedTokens": [
{
"offset": 14,
"token": "Sofyware",
"type": "UnknownToken",
"suggestions": [
{
"suggestion": "Software",
"score": 0.9140160264956476
}
]
}
]
}
here is some APIs you can check them out and select which one works for you.
And here is a package include english words that you can check if the word inside it; https://pub.dev/packages/list_english_words
This feature has landed in Flutter 3.7. To use it, add this parameter to your EditableText or TextField:
spellCheckConfiguration: kIsWeb ? null : SpellCheckConfiguration().
(The spell check configuration currently seems to break on web)

VSCode extension: disable repeating things in code completion

I am creating a language extension for VSCode using Java and the LSP4J library. It is something like this.
But I have a problem - if the user presses Ctrl+Space, and the language server returns an empty list, VSCode will still offers its options - things that are already in the code. How can I get it to display something like "No suggestions" instead?
The text-based completion you're seeing there can be disabled with the "editor.wordBasedSuggestions" setting.
Extensions can change the default value of a setting for a particular language by contributing configurationDefaults in package.json:
"contributes": {
"configurationDefaults": {
"[lang]": {
"editor.wordBasedSuggestions": false
}
}
}
Where lang is the ID of the language in question.
If the language server sends back an empty list you could add an artificial entry with text: "No suggestions" to the completion list.

VSCode autocomplete/intellisense for strings

While working with a PHP or JavaScript file in sublime, if I type the following code:
$test = "Scott";
If($test == null) {
$test2 = "Scott"
}
When I typed in “$test2 = ‘Sc...” Sublime would autocomplete “Scott” since it was a word it found as a string in the current document scope.
However, when I do the same test in VSCode, it doesn’t pick it up or offer any suggestions. Is this possible in VSCode? I have already turned on the quicksuggestions to all true in the preferences. I am not sure what else I could do here or if there is an additional plugin that I need to download. Thanks!
Like this?
My settings:
intelephense extension enabled
{
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
},
"editor.wordBasedSuggestions": true,
"php.suggest.basic": false
}
These are word based suggestions. They are controlled by the editor.wordBasedSuggestions setting.
However, word base suggestions will only show up when no valid language based suggestions are found (see https://github.com/Microsoft/vscode/issues/21611). JS should do the right thing inside strings here:
But the built-in php language support will still return language based suggestions inside strings, which is why the word based suggestions do not show up

Where are the docs on how to add symbol support for a language to Visual Studio Code?

I would like to add symbol support for PowerShell to VS Code but I'm not finding any docs on the code.visualstudio.com/docs site.
Also, is it possible to do this for a language like PowerShell that, for the moment, will only work on Windows? Is there a way to light up symbol support on Windows only?
BTW I've added a bunch of PowerShell snippets that I'm in the process of trying to get integrated into VS Code. Any help on how to get these snippets into the product would be appreciated as well? I did submit an issue on the snippets, suggesting that the team put these into VS Code.
There is currently no documentation for the plugin API. It's too early for this as the API is still changing with every minor release. The VSCode team is focused on providing a stable plugin API. There will be a documentation about it when it's done.
Nevertheless it is already possible to add a new language plugin or extending an exisiting one. Take a look on this short description on how to add declaration support for a new language: Create Custom Language in Visual Studio Code
You could add symbol support in a similar way. What you need is something like an abstract syntax tree builder for powershell scripts and an application or a javascript module that is able to process a JSON request in order to provide the correct symbols. An example request for outline support is this:
{
"seq":442,
"type":"request",
"command":"navbar",
"arguments":
{
"file":"c:/Users/C/Documents/projects/MyProject/MyFile.xxx"
}
}
A response could look like that:
{
"seq":442,
"type":"response",
"command":"navbar",
"request_seq":442,
"success":true,
"body":[
{
"text":"TObjA",
"kind":"class",
"kindModifiers":"",
"spans":[
{
"start":{
"line":10,
"offset":3
},
"end":{
"line":16,
"offset":4
}
}
],
"childItems":[
]
},
{
"text":"DoSomething",
"kind":"method",
"kindModifiers":"",
"spans":[
{
"start":{
"line":20,
"offset":1
},
"end":{
"line":27,
"offset":4
}
}
],
"childItems":[
]
},
]
}
I'm not sure what do you mean with "symbol support". Is it something like "jump to symbol inside the current file" using CTRL+Shift+O? Then you are looking for outlineSupport.
Is it something like "find a symbol in any file" using CTRL+P, #? Then you are looking for navigateTypesSupport.
Copy the needed .js file from the vs.langauage.csharp.o folder to the vs.langauage.powershell folder and register the support in powershellMain.js as it is done in omnisharpMain.js.
If you want to register the new support only on Windows then you can do it like this:
var isWin = /^win/.test(process.platform);
if(isWin)
monaco.Modes.NavigateTypesSupport.register('powershell', new navigateTypesSupport_1.default(ModelService, server));
I hope this helps for the moment. Don't forget to save your changed plugins in a different folder. VSCode often deletes changes in the plugin folders on update.