-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor PDV to get data directly from nxls & apply in intellij (…
- Loading branch information
Showing
40 changed files
with
1,599 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
apps/intellij/src/main/kotlin/dev/nx/console/models/NxPDVData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package dev.nx.console.models | ||
|
||
data class NxPDVData( | ||
val resultType: String, | ||
val graphBasePath: String?, | ||
val pdvDataSerialized: String?, | ||
val pdvDataSerializedMulti: Map<String, String>?, | ||
val errorsSerialized: String?, | ||
val errorMessage: String?, | ||
) { | ||
init { | ||
require( | ||
resultType == "SUCCESS" || | ||
resultType == "SUCCESS_MULTI" || | ||
resultType == "ERROR" || | ||
resultType == "NO_GRAPH_ERROR" || | ||
resultType == "OLD_NX_VERSION" | ||
) { | ||
"resultType must be of known type" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
apps/intellij/src/main/kotlin/dev/nx/console/models/NxTarget.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
apps/intellij/src/main/kotlin/dev/nx/console/models/NxVersion.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
package dev.nx.console.models | ||
|
||
import com.intellij.util.text.SemVer | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable() | ||
data class NxVersion(val minor: Int, val major: Int, val full: String) { | ||
public fun gte(other: NxVersion): Boolean { | ||
val semVerThis = SemVer.parseFromText(this.full) | ||
val semVerOther = SemVer.parseFromText(other.full) | ||
if (semVerThis != null && semVerOther != null) { | ||
return semVerThis >= semVerOther | ||
} | ||
if (this.major > other.major) { | ||
return true | ||
} else if (this.major == other.major) { | ||
return this.minor >= other.minor | ||
} | ||
return false | ||
} | ||
|
||
fun equals(other: NxVersion): Boolean { | ||
return this.major == other.major && this.minor == other.minor && this.full == other.full | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
apps/intellij/src/main/kotlin/dev/nx/console/nxls/server/requests/PDVDataRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package dev.nx.console.nxls.server.requests | ||
|
||
data class PDVDataRequest(val filePath: String) |
Oops, something went wrong.