Skip to content

Commit

Permalink
Small code cleanups and formatting tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dparnell committed Jan 8, 2022
1 parent f3ee9b5 commit 1d23260
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## [Unreleased]
- added hover documentation for functions and some help for the builtin functions
- added doc comment support for functions
- implemented rename for variables and references
- implemented rename refactor for variables and references
- better `++` and `--` in the parser

## [0.0.2]
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ Open a wgsl file in your IntelliJ based IDE and marvel at the pretty colours.

Download the [latest release](https://github.com/dparnell/intellij-wgsl/releases/latest) and install it manually using
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>


2 changes: 1 addition & 1 deletion src/main/java/wgslplugin/language/BuiltInFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class BuiltInFunctions {
private Map<String, WGSLFunctionDecl> functions = new HashMap<>();
private PsiElement[] allBuiltinFunctions;

public synchronized WGSLFunctionDecl get(WGSLFunctionCallElement element) {
public synchronized WGSLFunctionDecl get(PsiElement element) {
if(builtInFunctionsFile == null) {
InputStream s = BuiltInFunctions.class.getClassLoader().getResourceAsStream("/doc/builtInFunctions.wgsl");
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ public class WGSLDocumentationProvider extends AbstractDocumentationProvider {
StringBuilder b = new StringBuilder();
PsiElement e = originalElement == null ? element : originalElement;

b.append(DocumentationMarkup.DEFINITION_START);
b.append(DocumentationMarkup.CONTENT_START);
String fn = "```wgsl\n";
if (atts != null) {
fn = fn + atts.getText() + " ";
}
fn = fn + header.getText() + "\n```";
b.append(generateHTML(e, fn));
b.append(DocumentationMarkup.DEFINITION_END);
b.append(DocumentationMarkup.CONTENT_END);
b.append("<hr/>");

@Nullable WGSLDocs docs = func.getDocs();
if (docs != null) {
Expand Down

0 comments on commit 1d23260

Please sign in to comment.