Skip to content

Commit 40f4fca

Browse files
committed
Fix markdown-clj
1 parent 38c9d72 commit 40f4fca

File tree

7 files changed

+27
-127
lines changed

7 files changed

+27
-127
lines changed

build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repositories {
2323
}
2424

2525
dependencies {
26-
implementation ("org.clojure:clojure:1.11.1")
26+
implementation ("org.clojure:clojure:1.12.0")
2727
implementation ("com.github.ericdallo:clj4intellij:0.5.4")
2828
implementation ("seesaw:seesaw:1.5.0")
2929
implementation ("camel-snake-kebab:camel-snake-kebab:0.4.3")
@@ -36,7 +36,10 @@ dependencies {
3636
exclude("org.clojure", "core.async")
3737
}
3838
implementation ("com.rpl:proxy-plus:0.0.9")
39-
// implementation ("markdown-clj:markdown-clj:1.12.1")
39+
implementation ("markdown-clj:markdown-clj:1.12.1") {
40+
exclude("clj-commons", "clj-yaml")
41+
}
42+
implementation ("clj-commons:clj-yaml:1.0.29")
4043
}
4144

4245
sourceSets {

src/main/clojure/com/github/clojure_lsp/intellij/extension/clojure_module_builder.clj

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
[com.intellij.openapi.module ModifiableModuleModel ModuleType]
1818
[com.intellij.openapi.project Project]
1919
[com.intellij.openapi.roots ModifiableRootModel]
20-
[java.io File]))
20+
[java.io File]
21+
[java.net JarURLConnection]
22+
[java.util.jar JarEntry]))
23+
24+
(set! *warn-on-reflection* true)
2125

2226
(def clojure-module
2327
(proxy+ ClojureModuleType ["CLOJURE_MODULE"] ModuleType
@@ -77,8 +81,7 @@
7781
(updateDataModel [_]
7882
(swap! wizard* assoc :project-type (s/id-of (s/selection (:button-group @wizard*)))))))
7983

80-
(defn -setupRootModel [^ModuleBuilder this ^ModifiableRootModel model]
81-
(.doAddContentEntry this model))
84+
(defn -setupRootModel [^ModuleBuilder _ ^ModifiableRootModel _])
8285

8386
(defn ^:private normalize-entry-name [entry-name project-template project-name]
8487
(-> entry-name
@@ -98,10 +101,10 @@
98101
;; We need to update current thread class loader to be able to
99102
;; load resource-paths from our plugin.
100103
(.setContextClassLoader (Thread/currentThread) (.getClassLoader clojure.lang.Symbol))
101-
(let [connection (.openConnection (io/resource project-template))
104+
(let [connection ^JarURLConnection (.openConnection (io/resource project-template))
102105
project-root-entry (.getJarEntry connection)]
103106
(with-open [jar (.getJarFile connection)]
104-
(doseq [entry (enumeration-seq (.entries jar))]
107+
(doseq [^JarEntry entry (enumeration-seq (.entries jar))]
105108
(when (and (not (.isDirectory entry))
106109
(string/starts-with? (str entry) (str project-root-entry)))
107110
(with-open [stream (.getInputStream jar entry)]
@@ -110,9 +113,13 @@
110113
(io/make-parents new-file)
111114
(spit new-file content))))))))
112115

116+
(set! *warn-on-reflection* false)
117+
113118
(defn -commitModule [this ^Project project ^ModifiableModuleModel model]
114119
(let [project-path (.getBasePath project)
115120
project-name (.getName project)
116121
template (project-template (:project-type @wizard*))]
117122
(copy-template template project-path project-name)
118123
(.superCommitModule this project model)))
124+
125+
(set! *warn-on-reflection* true)

src/main/clojure/com/github/clojure_lsp/intellij/extension/documentation.clj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
(:require
66
[com.github.clojure-lsp.intellij.client :as lsp-client]
77
[com.github.clojure-lsp.intellij.db :as db]
8-
#_[markdown.core :as markdown])
8+
[markdown.core :as markdown])
99
(:import
10+
[com.github.clojure_lsp.intellij ClojureLanguage]
11+
[com.intellij.openapi.editor.colors EditorColorsManager]
12+
[com.intellij.openapi.fileTypes SyntaxHighlighterFactory]
1013
[com.intellij.openapi.util.text StringUtil]
1114
[com.intellij.openapi.util.text HtmlBuilder]
1215
[com.intellij.psi PsiDocumentManager PsiElement PsiFile]
13-
[com.intellij.openapi.fileTypes SyntaxHighlighterFactory]
14-
[com.intellij.openapi.editor.colors EditorColorsManager]
15-
[com.github.clojure_lsp.intellij ClojureLanguage]
1616
[java.awt Color]))
1717

1818
(set! *warn-on-reflection* true)
@@ -57,10 +57,10 @@
5757
foreground-color (some-> highlight-attrs .getForegroundColor)
5858
background-color (some-> highlight-attrs .getBackgroundColor)
5959
font-type (some-> highlight-attrs .getFontType (#(case (int %)
60-
1 :bold
61-
2 :italic
62-
3 :bold-italic
63-
nil)))]
60+
1 :bold
61+
2 :italic
62+
3 :bold-italic
63+
nil)))]
6464
(if (some some? [foreground-color background-color font-type])
6565
(recur (str highlighted-code (highlight-html-text text {:foreground-color foreground-color
6666
:background-color background-color
@@ -80,7 +80,7 @@
8080
:position {:line (.line line-col)
8181
:character (.column line-col)}}])]
8282

83-
(when-let [html "" #_(markdown/md-to-html-string (:value contents)
83+
(when-let [html (markdown/md-to-html-string (:value contents)
8484
:codeblock-no-escape? true
8585
:codeblock-callback (fn [code language]
8686
(if (= language "clojure")

src/main/clojure/com/github/clojure_lsp/intellij/listener/file.clj

Lines changed: 0 additions & 96 deletions
This file was deleted.

src/main/clojure/com/github/clojure_lsp/intellij/server.clj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88

99
(set! *warn-on-reflection* true)
1010

11-
(def ^:private client-capabilities
12-
{:text-document {:hover {:content-format ["markdown"]}
13-
:implementation {}}
14-
:workspace {:workspace-edit {:document-changes true
15-
:resource-operations ["create" "rename"]}
16-
:file-operations {:will-rename true}}
17-
:window {:show-document true}})
18-
1911
(defn start-server! [^Project project]
2012
(when-let [item ^LanguageServerItem @(db/get-in project [:server])]
2113
(when-let [server ^LanguageServerManager (.getServer item)]

src/main/resources/META-INF/plugin.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,7 @@
121121
</applicationListeners>
122122

123123
<projectListeners>
124-
<!-- <listener topic="com.intellij.openapi.fileEditor.FileEditorManagerListener" -->
125-
<!-- class="com.github.clojure_lsp.intellij.listener.FileListener"/> -->
126124
<listener topic="com.intellij.openapi.project.ProjectManagerListener"
127125
class="com.github.clojure_lsp.intellij.listener.ProjectManagerListener"/>
128-
<!-- TODO listen to vfs events outside editor -->
129-
<!-- <listener topic="com.intellij.openapi.vfs.newvfs.BulkFileListener" -->
130-
<!-- class="com.github.clojure_lsp.intellij.listener.FileListener"/> -->
131-
132126
</projectListeners>
133127
</idea-plugin>

src/main/resources/project-templates/lein/project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
:url "http://example.com/FIXME"
44
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
55
:url "https://www.eclipse.org/legal/epl-2.0/"}
6-
:dependencies [[org.clojure/clojure "1.11.1"]]
6+
:dependencies [[org.clojure/clojure "1.12.0"]]
77
:repl-options {:init-ns project-name.core})

0 commit comments

Comments
 (0)