Skip to content

Commit

Permalink
New Release (v1.3.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
marius-h committed Apr 19, 2020
1 parent fd20efd commit 8aca63c
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 17 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ You can install plugin directly from IntelliJ IDEA or Android Studio:

## :fire: What's new?

### 1.3.2
<ul>
<li>Fixed Error getting Flutter SDK information when auto-completing a package (#44)</li>
<li>Fixed Error when generating a new bloc (#28,#33)</li>
<li>Fixed Incompatibility with Kubernetes plugin (#30)</li>
</ul>

### 1.3.1
<ul>
<li>Improved pub documentation view</li>
Expand Down
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ intellij {
version "$ideaVersion"
updateSinceUntilBuild false

plugins = ["Kotlin", "yaml", "Dart:$dartVersion", "io.flutter:$flutterVersion"]
plugins = ["Kotlin", "yaml", "Dart:$dartVersion", "io.flutter:$flutterVersion", "java"]
}

publishPlugin {
Expand All @@ -62,6 +62,12 @@ publishPlugin {

patchPluginXml {
changeNotes """
<h2>1.3.2</h2>
<ul>
<li>Fixed Error getting Flutter SDK information when auto-completing a package (#44)</li>
<li>Fixed Error when generating a new bloc (#28,#33)</li>
<li>Fixed Incompatibility with Kubernetes plugin (#30)</li>
</ul>
<h2>1.3.1</h2>
<ul>
<li>Improved pub documentation view</li>
Expand Down
17 changes: 12 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
version=1.3.1
version=1.3.2
org.gradle.parallel=true
#ideaVersion = 2019.2
ideaVersion=191.7479.19

# 2019.2
ideaVersion=192.7142.36
dartVersion=192.7761
flutterVersion=45.1.1

# 2020.1
#ideaVersion=201.6668.121
#dartVersion=201.6668.156
#flutterVersion=45.1.3

javaVersion=1.8
kotlinVersion=1.3.41
dartVersion=191.7479.14
flutterVersion=38.1.3
pluginVerifierVersion=1.211
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
package de.mariushoefler.flutter_enhancement_suite.actions

import com.intellij.openapi.paths.GlobalPathReferenceProvider
import com.intellij.openapi.paths.PathReferenceManager
import com.intellij.openapi.util.TextRange
import com.intellij.openapi.util.UserDataCache
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vcs.IssueNavigationConfiguration
import com.intellij.patterns.PsiElementPattern
import com.intellij.psi.*
import com.intellij.psi.impl.source.resolve.reference.ArbitraryPlaceUrlReferenceProvider
import com.intellij.psi.util.CachedValue
import com.intellij.psi.util.CachedValueProvider
import com.intellij.psi.util.CachedValuesManager
import com.intellij.util.ProcessingContext
import com.intellij.util.SmartList
import org.jetbrains.kotlin.idea.completion.returnExpressionItems
import java.util.concurrent.atomic.AtomicReference

class DocProvider : PsiReferenceProvider() {
Expand All @@ -29,8 +26,8 @@ class DocProvider : PsiReferenceProvider() {

override fun compute(element: PsiElement, p: Any): CachedValue<Array<PsiReference>> {
return CachedValuesManager.getManager(element.project).createCachedValue({
val navigationConfiguration = IssueNavigationConfiguration.getInstance(element.project) ?:
return@createCachedValue CachedValueProvider.Result.create<Array<PsiReference>>(PsiReference.EMPTY_ARRAY)
val navigationConfiguration = IssueNavigationConfiguration.getInstance(element.project)
?: return@createCachedValue CachedValueProvider.Result.create<Array<PsiReference>>(PsiReference.EMPTY_ARRAY)

var refs: MutableList<PsiReference>? = null
var provider: GlobalPathReferenceProvider? = myReferenceProvider.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class UrlDocumentationProvider : AbstractDocumentationProvider() {
val lookupString = when {
element is SuggestionElement -> element.name
element.text.isPubPackageName() -> element.firstChild.text
element.containingFile.isPubspecFile() -> return null
else -> return null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class NewFlutterBlocAction : AnAction(IconLoader.getIcon("/icons/bloc_icon16.png
SimpleClassNameInputValidator()
)

if (name?.isBlank() != false) {
if (name?.isBlank() != false || event.getData(LangDataKeys.PSI_ELEMENT) !is PsiDirectory) {
return
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.mariushoefler.flutter_enhancement_suite.utils

import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ProjectLocator
import com.intellij.openapi.vfs.VfsUtil
Expand All @@ -18,7 +19,7 @@ import java.io.IOException
object FlutterProjectUtils {

fun readProjectName(project: Project): String? {
val pubspec = VfsUtil.findFileByIoFile(File("${project.basePath}/pubspec.yaml"), false) ?: return null
val pubspec = VfsUtil.findFileByIoFile(File("${project.basePath}/pubspec.yaml"), true) ?: return null
val properties = readPubspecFileToMap(pubspec)
return properties?.get("name") as String
}
Expand Down Expand Up @@ -55,11 +56,16 @@ object FlutterProjectUtils {
* @since v1.2
*/
fun runPackagesGet(file: VirtualFile?) {
val project = ProjectLocator.getInstance().guessProjectForFile(file)
val sdk = project?.let { FlutterSdk.getFlutterSdk(it) }
PubRoot.forDirectory(file?.parent)?.let { pubRoot ->
ProjectLocator.getInstance().guessProjectForFile(file)?.let { project ->
FileDocumentManager.getInstance().saveAllDocuments()
val module = pubRoot.getModule(project)
if (module != null) {
FlutterSdk.getFlutterSdk(project)?.flutterPackagesGet(pubRoot)?.startInModuleConsole(module, { pubRoot.refresh() }, null)
}

PubRoot.forDirectory(file?.parent)?.let {
sdk?.startPackagesGet(it, project)
//startPackagesGet(pubRoot, project)
}
}
}
}

0 comments on commit 8aca63c

Please sign in to comment.