Skip to content

Commit

Permalink
feat: expose MicroProfile server settings
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon authored and angelozerr committed Aug 28, 2023
1 parent a0e94de commit d379c70
Show file tree
Hide file tree
Showing 28 changed files with 586 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,21 @@ protected synchronized Runnable getDidChangeConfigurationListener() {
if (didChangeConfigurationListener != null) {
return didChangeConfigurationListener;
}
didChangeConfigurationListener = () -> {
LanguageServer languageServer = getLanguageServer();
if (languageServer == null) {
return;
}
Object settings = createSettings();
if(settings == null) {
return;
}
DidChangeConfigurationParams params = new DidChangeConfigurationParams(settings);
languageServer.getWorkspaceService().didChangeConfiguration(params);
};
didChangeConfigurationListener = this::triggerChangeConfiguration;
return didChangeConfigurationListener;
}

protected void triggerChangeConfiguration() {
LanguageServer languageServer = getLanguageServer();
if (languageServer == null) {
return;
}
Object settings = createSettings();
if(settings == null) {
return;
}
DidChangeConfigurationParams params = new DidChangeConfigurationParams(settings);
languageServer.getWorkspaceService().didChangeConfiguration(params);
}

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*******************************************************************************
* Copyright (c) 2023 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*
* Contributors:
* Red Hat Inc. - initial API and implementation
*******************************************************************************/
package com.redhat.devtools.intellij.lsp4mp4ij.psi.core.inspections;

import com.intellij.codeInspection.LocalInspectionTool;

/**
* No-op {@link LocalInspectionTool} used as a basis for mapping inspection severities to matching LSP severities.
*/
public abstract class AbstractDelegateInspection extends LocalInspectionTool {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2023 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*
* Contributors:
* Red Hat Inc. - initial API and implementation
*******************************************************************************/
package com.redhat.devtools.intellij.lsp4mp4ij.psi.core.inspections;

/**
* Dummy inspection for duplicate properties in Microprofile properties files
*/
public class MicroProfilePropertiesDuplicatesInspection extends AbstractDelegateInspection {
public static final String ID = getShortName(MicroProfilePropertiesDuplicatesInspection.class.getSimpleName());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2023 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*
* Contributors:
* Red Hat Inc. - initial API and implementation
*******************************************************************************/
package com.redhat.devtools.intellij.lsp4mp4ij.psi.core.inspections;

/**
* Dummy inspection for expression values in Microprofile properties files
*/
public class MicroProfilePropertiesExpressionsInspection extends AbstractDelegateInspection {
public static final String ID = getShortName(MicroProfilePropertiesExpressionsInspection.class.getSimpleName());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2023 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*
* Contributors:
* Red Hat Inc. - initial API and implementation
*******************************************************************************/
package com.redhat.devtools.intellij.lsp4mp4ij.psi.core.inspections;

/**
* Dummy inspection for missing required properties in Microprofile properties files
*/
public class MicroProfilePropertiesRequiredInspection extends AbstractDelegateInspection {
public static final String ID = getShortName(MicroProfilePropertiesRequiredInspection.class.getSimpleName());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2023 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*
* Contributors:
* Red Hat Inc. - initial API and implementation
*******************************************************************************/
package com.redhat.devtools.intellij.lsp4mp4ij.psi.core.inspections;

/**
* Dummy inspection for property syntax errors in Microprofile properties files
*/
public class MicroProfilePropertiesSyntaxInspection extends AbstractDelegateInspection {
public static final String ID = getShortName(MicroProfilePropertiesSyntaxInspection.class.getSimpleName());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2023 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*
* Contributors:
* Red Hat Inc. - initial API and implementation
*******************************************************************************/
package com.redhat.devtools.intellij.lsp4mp4ij.psi.core.inspections;

/**
* Dummy inspection for unknown properties in Microprofile properties files
*/
public class MicroProfilePropertiesUnknownInspection extends AbstractDelegateInspection {
public static final String ID = getShortName(MicroProfilePropertiesUnknownInspection.class.getSimpleName());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2023 Red Hat Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*
* Contributors:
* Red Hat Inc. - initial API and implementation
*******************************************************************************/
package com.redhat.devtools.intellij.lsp4mp4ij.psi.core.inspections;

/**
* Dummy inspection for invalid values in Microprofile properties files
*/
public class MicroProfilePropertiesValueInspection extends AbstractDelegateInspection {
public static final String ID = getShortName(MicroProfilePropertiesValueInspection.class.getSimpleName());
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class MicroProfileConfigurable extends NamedConfigurable<UserDefinedMicro

private MicroProfileView myView;

public MicroProfileConfigurable(Project project) {
public MicroProfileConfigurable(Project ignoredProject) {
}

@Override
Expand Down Expand Up @@ -58,10 +58,8 @@ public void setDisplayName(String name) {
return MicroProfileBundle.message("microprofile");
}


@Override
public boolean isModified() {
if (myView == null) return false;
return false;
}

Expand Down
Loading

0 comments on commit d379c70

Please sign in to comment.