Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #20 from MarioAriasC/0.0.7
Browse files Browse the repository at this point in the history
0.0.7
  • Loading branch information
MarioAriasC authored Jul 28, 2022
2 parents 6d7d6c6 + bddaf1b commit 829176e
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 18 deletions.
32 changes: 21 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@
# zig-support Changelog

## [Unreleased]

### Added
- More Live Templates for Zig:
- `St` -> `[]const u8`
- `tst` -> Creates a test: `test "" {}`
- `csd` -> Constant `Self` declaration: `const Self = @This();`
- `ced` -> Enum
- `cstd` -> Struct
- `fn0` -> Function without parameters
- `fn1` -> Function with one parameter
- `fn2` -> Function with two parameters
- Support for the new IDEA platform version 2022.2
## [0.0.6]
### Added
- Improved parser: 100% of the language is parsed correctly.
- Insert closing pair match for `(`, `{`, `[` and `"`
- Highlight `(`, `{` and `[` pairs
- Introduce Live Templates for Zig:
- `import` -> Create an import using the `@import` function
- `sdp` -> Debug Print statement
- `sli` -> Log Info statement

### Fixed
### Added
- Improved parser: 100% of the language is parsed correctly.
- Insert closing pair match for `(`, `{`, `[` and `"`
- Highlight `(`, `{` and `[` pairs
- Introduce Live Templates for Zig:
- `import` -> Create an import using the `@import` function
- `sdp` -> Debug Print statement
- `sli` -> Log Info statement

### Fixed
- Fix issue [#15](https://github.com/MarioAriasC/zig-support/issues/15)

## [0.0.5]
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

pluginGroup = com.github.marioariasc.zigsupport
pluginName = zig-support
pluginVersion = 0.0.6
pluginVersion = 0.0.7

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild = 211
pluginUntilBuild = 221.*
pluginSinceBuild = 213
pluginUntilBuild = 222.*


platformType = IC
platformVersion = 2021.1.3
platformVersion = 2021.3.3

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ZigCompletionContributor : CompletionContributor() {
}

private val lookupLowerCase = { element: IElementType ->
val lowerCased = element.toString().toLowerCase()
val lowerCased = element.toString().lowercase()
LookupElementBuilder
.create(lowerCased)
.withPresentableText(lowerCased)
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/org/ziglang/jb/types/utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ fun ZigPrimaryTypeExpr.type(context: Context): Type? {
fun ZigContainerDecl.type(context: Context): Type? {
return context.cacheType(this) {
when (firstChild?.firstChild?.text) {
ZigTypes.STRUCT.toString().toLowerCase() -> context.getStructType(this)
ZigTypes.ENUM.toString().toLowerCase() -> context.getEnumType(this)
ZigTypes.STRUCT.toString().lowercase() -> context.getStructType(this)
ZigTypes.ENUM.toString().lowercase() -> context.getEnumType(this)
else -> null
}
}
Expand Down
52 changes: 52 additions & 0 deletions src/main/resources/liveTemplates/Zig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,56 @@
<option name="ZIG_CODE" value="true"/>
</context>
</template>
<template description="String a.k.a []const u8" name="St" value="[]const u8">
<context>
<option name="ZIG_CODE" value="true"/>
</context>
</template>
<template description="Test" name="tst" value="test &quot;$NAME$&quot; {$END$}">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true"/>
<context>
<option name="ZIG_CODE" value="true"/>
</context>
</template>
<template description="Self declaration" name="csd" value="const Self = @This();">
<context>
<option name="ZIG_CODE" value="true"/>
</context>
</template>
<template description="Enum declaration" name="ced" value="const $NAME$ = enum {$END$};">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true"/>
<context>
<option name="ZIG_CODE" value="true"/>
</context>
</template>
<template description="Struct declaration" name="cstd" value="const $NAME$ = struct {$END$};">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true"/>
<context>
<option name="ZIG_CODE" value="true"/>
</context>
</template>
<template description="Function declaration without parameters" name="fn0" value="fn $NAME$() $RETURN$ {$END$}">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true"/>
<variable name="RETURN" expression="" defaultValue="" alwaysStopAt="true"/>
<context>
<option name="ZIG_CODE" value="true"/>
</context>
</template>
<template description="Function declaration with one parameter" name="fn1" value="fn $NAME$($PARAM1$) $RETURN$ {$END$}">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true"/>
<variable name="PARAM1" expression="" defaultValue="" alwaysStopAt="true"/>
<variable name="RETURN" expression="" defaultValue="" alwaysStopAt="true"/>
<context>
<option name="ZIG_CODE" value="true"/>
</context>
</template>
<template description="Function declaration with two parameters" name="fn2" value="fn $NAME$($PARAM1$, $PARAM2$) $RETURN$ {$END$}">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true"/>
<variable name="PARAM1" expression="" defaultValue="" alwaysStopAt="true"/>
<variable name="PARAM2" expression="" defaultValue="" alwaysStopAt="true"/>
<variable name="RETURN" expression="" defaultValue="" alwaysStopAt="true"/>
<context>
<option name="ZIG_CODE" value="true"/>
</context>
</template>
</templateSet>

0 comments on commit 829176e

Please sign in to comment.