Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hurricup/fixes #2952

Merged
merged 4 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ jobs:
run: ./gradlew :coveralls --console plain

- name: Perform SonarCube Analysis
if: ${{ env.COVERALLS_REPO_TOKEN }}
if: ${{ env.COVERALLS_REPO_TOKEN && env.SONAR_TOKEN }}
run: ./gradlew sonarqube --info --console plain
4 changes: 2 additions & 2 deletions plugin/core/grammar/Perl.flex
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ AMBIGOUS_PACKAGES="version"|"JSON"|"YAML"|"Test"
TEXT_OPERATORS = "x"|"and"|"or"|"xor"|"lt"|"gt"|"le"|"ge"|"ne"|"eq"|"cmp"|"isa"

REGEX_COMMENT = "(?#"[^)]*")"
REGEX_ARRAY_NEGATING = [\^\:\\\[\{\.\,\'\"})]
REGEX_HASH_NEGATING = [\^\:\\\[\{\.\,]
REGEX_ARRAY_NEGATING = [\^\:\\\[\{\.\,\'\"})/]
REGEX_HASH_NEGATING = [\^\:\\\[\{\.\,/]
HANDLE_NEGATING = {MAY_BE_SPACES_OR_COMMENTS} ("("|"->"|":")
PRINT_HANDLE_NEGATING = {MAY_BE_SPACES_OR_COMMENTS} ("("|"->"|":"|";"|"=>"|"&&"|"||"|",")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2585,10 +2585,10 @@ private static int zzUnpackRowMap(String packed, int offset, int [] result) {
"\1\0\1\u05e7\140\0\1\u0599\34\0\6\u0288\7\0\31\u0288"+
"\4\0\1\u0288\1\0\32\u0288\5\0\2\u0288\1\0\1\u0288"+
"\42\0\1\u0287\1\0\36\u0287\105\0\1\u05e9\115\0\1\u05ea"+
"\4\0\1\u05ea\1\0\1\u05ea\2\0\1\u05ea\1\0\1\u05ea"+
"\7\0\1\u05ea\37\0\2\u05ea\1\0\1\u05ea\34\0\1\u05ea"+
"\4\0\1\u05ea\1\0\1\u05ea\2\0\1\u05ea\1\0\2\u05ea"+
"\6\0\1\u05ea\37\0\2\u05ea\1\0\1\u05ea\34\0\1\u05ea"+
"\1\0\1\u05ea\10\0\1\u05eb\2\0\1\u05eb\1\0\1\u05eb"+
"\13\0\1\u05ea\1\u05ec\1\u05ea\7\0\1\u05ea\6\0\31\u05ed"+
"\13\0\1\u05ea\1\u05ec\2\u05ea\6\0\1\u05ea\6\0\31\u05ed"+
"\2\u05ea\1\0\1\u05ea\1\u05ed\1\0\32\u05ed\1\u05ea\4\0"+
"\1\u05ed\106\0\1\u05ee\15\0\1\u05ef\156\0\1\u05f0\126\0"+
"\1\u05f1\160\0\1\u05f2\143\0\1\u05f3\124\0\1\u05f4\77\0"+
Expand Down Expand Up @@ -6374,7 +6374,7 @@ private static int zzUnpackRowMap(String packed, int offset, int [] result) {
"\4\0\1\u05d5\7\0\6\u0277\1\u05d6\6\0\31\u0277\4\0"+
"\1\u0277\1\0\13\u0277\1\u0bcf\16\u0277\5\0\2\u0277\1\0"+
"\1\u0277\11\0\1\u0bd0\4\0\1\u0bd0\1\0\1\u0bd0\2\0"+
"\1\u0bd0\1\0\1\u0bd0\7\0\1\u0bd0\37\0\2\u0bd0\1\0"+
"\1\u0bd0\1\0\2\u0bd0\6\0\1\u0bd0\37\0\2\u0bd0\1\0"+
"\1\u0bd0\34\0\1\u0bd0\1\0\1\u0bd0\10\0\1\u090b\2\0"+
"\1\u090b\1\0\1\u090b\127\0\1\u090c\113\0\1\u0bd1\166\0"+
"\1\u0bd2\126\0\1\u0bd3\141\0\1\u0bd4\151\0\1\u0bd5\143\0"+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
private static final String ATTRIBUTE_TYPE = "type";
private final boolean myIsWritable;
private long myModificationTracker;
private PerlModuleExtension myOriginal;

Check warning on line 59 in plugin/core/src/main/java/com/intellij/openapi/projectRoots/impl/PerlModuleExtension.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Declaration can have 'final' modifier

Declaration can have final modifier

Check warning on line 59 in plugin/core/src/main/java/com/intellij/openapi/projectRoots/impl/PerlModuleExtension.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Field may be 'final'

Field `myOriginal` may be 'final'
private Module myModule;

Check warning on line 60 in plugin/core/src/main/java/com/intellij/openapi/projectRoots/impl/PerlModuleExtension.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Declaration can have 'final' modifier

Declaration can have final modifier

Check warning on line 60 in plugin/core/src/main/java/com/intellij/openapi/projectRoots/impl/PerlModuleExtension.java

View workflow job for this annotation

GitHub Actions / Qodana for JVM

Field may be 'final'

Field `myModule` may be 'final'
private Map<VirtualFile, PerlSourceRootType> myRoots = new LinkedHashMap<>();
private Throwable myDisposalTrace;

public PerlModuleExtension(Module module) {
myModule = module;
Expand Down Expand Up @@ -97,7 +96,6 @@

@Override
public boolean isChanged() {
assertNotDisposed();
return !myRoots.equals(myOriginal.myRoots);
}

Expand Down Expand Up @@ -129,21 +127,6 @@
return myRoots.get(virtualFile);
}

private void assertNotDisposed() {
if (myDisposalTrace != null) {
throw new RuntimeException("Already disposed", myDisposalTrace);
}
}

@Override
public void dispose() {
assertNotDisposed();
myOriginal = null;
myModule = null;
myRoots = null;
myDisposalTrace = new Throwable("Disposal trace");
}

@Override
public long getStateModificationCount() {
return myModificationTracker;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 Alexandr Evstigneev
* Copyright 2015-2024 Alexandr Evstigneev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,8 +16,12 @@

package com.perl5.lang.perl.idea.configuration.module;

import com.intellij.openapi.ui.VerticalFlowLayout;

import javax.swing.*;

public class PerlProjectGeneratorPeer extends PerlProjectGeneratorPeerBase<PerlProjectGenerationSettings> {
public PerlProjectGeneratorPeer() {
super(new PerlProjectGenerationSettings());
super(new PerlProjectGenerationSettings(), new JPanel(new VerticalFlowLayout()));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2020 Alexandr Evstigneev
* Copyright 2015-2024 Alexandr Evstigneev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@
package com.perl5.lang.perl.idea.configuration.module;

import com.intellij.openapi.options.UnnamedConfigurable;
import com.intellij.openapi.ui.VerticalFlowLayout;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.util.AtomicNotNullLazyValue;
import com.intellij.platform.GeneratorPeerImpl;
import com.perl5.lang.perl.idea.configuration.settings.sdk.Perl5SdkConfigurable;
Expand All @@ -28,17 +28,27 @@

public abstract class PerlProjectGeneratorPeerBase<Settings extends PerlProjectGenerationSettings> extends GeneratorPeerImpl<Settings>
implements UnnamedConfigurable {
private final @NotNull JComponent myMainComponent;
private final @NotNull Perl5SdkConfigurable mySdkConfigurable;
private final AtomicNotNullLazyValue<JComponent> myComponentProvider = AtomicNotNullLazyValue.createValue(
() -> initializeComponent(super.getComponent()));
this::initializeComponent);

public PerlProjectGeneratorPeerBase(@NotNull Settings settings) {
super(settings, new JPanel(new VerticalFlowLayout()));
public PerlProjectGeneratorPeerBase(@NotNull Settings settings, @NotNull JComponent mainComponent) {
super(settings, mainComponent);
myMainComponent = mainComponent;
mySdkConfigurable = new Perl5SdkConfigurable(getSettings(), null);
}

@Override
public final @NotNull JComponent getComponent() {
public @NotNull JComponent getComponent(@NotNull TextFieldWithBrowseButton myLocationField, @NotNull Runnable checkValid) {
// this initializes parent parts
super.getComponent(myLocationField, checkValid);
return myComponentProvider.getValue();
}

@SuppressWarnings("deprecation")
@Override
public @NotNull JComponent getComponent() {
return myComponentProvider.getValue();
}

Expand All @@ -47,15 +57,15 @@ public void disposeUIResources() {
mySdkConfigurable.disposeUIResources();
}

protected @NotNull JComponent initializeComponent(@NotNull JComponent component) {
component.add(mySdkConfigurable.createComponent());
protected @NotNull JComponent initializeComponent() {
myMainComponent.add(mySdkConfigurable.createComponent());
mySdkConfigurable.setEnabled(PerlProjectManager.getSdk(getSettings().getProject()) == null);
return component;
return myMainComponent;
}

@Override
public final @NotNull JComponent createComponent() {
return getComponent();
return myMainComponent;
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions plugin/src/test/java/unit/perl/parser/PerlParserLikeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ protected String getBaseDataPath() {
return "unit/perl/parser";
}

@Test
public void testIndexesAsRegexInterpolated() { doTest(); }

@Test
public void testDoubleBuckConcat() { doTest(false); }

Expand Down
Loading
Loading