Godot / GDScript: Autocomplete not working - autocomplete

So, I started learning with the 3.0 RC1 version of the Godot Engine and I noticed, that code completion isn't working. No suggestions, no completions, nothing. Only highlighting and bracket completion works. Is that because of the RC1 or am I missing something? Code completion is enable in editor settings.
Thanks alot.
Greetings, Nils

Since Godot 3.1 you can use typed variables in GDScript like this:
var myTexture : ImageTexture
And then autocomplete will work a little better for those. Otherwise Godot can not always figure out what type your variable is.

Solved this myself. I just weren't writing the code inside the scene functions.

Related

Appcode chaining methods indentation does not match with xcode indentation

XCode indents method chaining like this:
xcode method chaining indentation
However if I press auto-format on appcode, it formats it in a weird way:
appcode method chaining indentation
Does appcode have a configuration in the code-style to fix this? When I look into their coding style for swift, I can't seem to find the configuration to change this behavior.
Anyone know a way to solve this? Thanks.
EDIT:
Another more convenient option is to use https://plugins.jetbrains.com/plugin/7177-file-watchers
with next conf:
More in docs:
https://www.jetbrains.com/help/idea/using-file-watchers.html#showFileWatcherInfoInEditor
PREVIOUS:
AppCode issue is very old...
So i solved it using https://github.com/nicklockwood/SwiftFormat :
brew install swiftformat
Add External Tools
(program: /path/to/swiftformat, arguments: $FilePath$, working directory: $ProjectFileDir):
Add KeyMap to your taste:

Swift Brackets to Java Brackets [duplicate]

I have noticed that the coding style in Swift appears to be to put braces on the same line as a method signature or if statement etc. Without getting into a debate about which is right or wrong, my aim is simply tom get Xcode to put the braces on a new line when it does its auto completion and for the new file templates.
I've tried the advice here and it doesn't work: https://forums.developer.apple.com/thread/23087
I'm using Xcode 8.1 on Sierra.
Has anyone else been able to get this to work?
Thanks,
Alan
You can use below methods in conjunction to accomplish this task.
ClangFormat and Uncrustify
Above method will only change the default statement templates and not the inbuilt methods formatting. (i.e autofilled viewDidLoad() method will still have the braces in the same line.) For this you should consider using these plugins. They have options to save the file with specified format.
(UPDATE Snippet Edit no longer works)
Snippet Edit
Snippet Edit is a small program that is used to edit the Xcode's standard code snippets. We have to do this way because there is no direct way to change the code style in Xcode settings and XCCodeSenseFormattingOptions is not supported since Xcode 4
You can follow below screenshot for reference. Remember to restart Xcode once you are done with editing.

Is it possible to preview code start in vs code?

Well i am coming from Visual Studio where there is a feature to see a preview of the start of any code that isn't in the editor. ex if you are down at the end of an if statement or end of a method in C#, or even tag closings in HTML.
Here is a pic of what i mean. And sorry i can't even search for that cause i don't know what such feature is called.
Any extension might be nice.
Edit: this is actually a Resharper Ultimate feature called highlight matching delimiter
This is not available in VS code.

How to make Xcode put starting brace on new line in Swift?

I have noticed that the coding style in Swift appears to be to put braces on the same line as a method signature or if statement etc. Without getting into a debate about which is right or wrong, my aim is simply tom get Xcode to put the braces on a new line when it does its auto completion and for the new file templates.
I've tried the advice here and it doesn't work: https://forums.developer.apple.com/thread/23087
I'm using Xcode 8.1 on Sierra.
Has anyone else been able to get this to work?
Thanks,
Alan
You can use below methods in conjunction to accomplish this task.
ClangFormat and Uncrustify
Above method will only change the default statement templates and not the inbuilt methods formatting. (i.e autofilled viewDidLoad() method will still have the braces in the same line.) For this you should consider using these plugins. They have options to save the file with specified format.
(UPDATE Snippet Edit no longer works)
Snippet Edit
Snippet Edit is a small program that is used to edit the Xcode's standard code snippets. We have to do this way because there is no direct way to change the code style in Xcode settings and XCCodeSenseFormattingOptions is not supported since Xcode 4
You can follow below screenshot for reference. Remember to restart Xcode once you are done with editing.

How to enable automatic method suggestion in swift in Xcode?

i am learning swift programming language. Unlike objective-c , it does not have automatic method suggestion and variable replacement. Is there any trick or setting for automatic method suggestion in swift?
Thanks in advance.
If you're referring to autocomplete, Swift does have autocomplete, but it's buggy and sometimes breaks. If it's not working, try deleting the derived data for your project and letting it re-index. The directory should be at ~/Library/Developer/Xcode/DerivedData/