mirror of
				https://github.com/chylex/IntelliJ-Inspection-Lens.git
				synced 2025-10-31 02:17:14 +01:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			1c92cf000f
			...
			223fceb6b9
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 223fceb6b9 | |||
| 640d95cddc | |||
| fcd4d6588d | 
| @@ -8,7 +8,7 @@ plugins { | ||||
| } | ||||
|  | ||||
| group = "com.chylex.intellij.inspectionlens" | ||||
| version = "1.3.2" | ||||
| version = "1.3.3" | ||||
|  | ||||
| repositories { | ||||
| 	mavenCentral() | ||||
|   | ||||
| @@ -0,0 +1,23 @@ | ||||
| package com.chylex.intellij.inspectionlens.compatibility | ||||
|  | ||||
| import com.chylex.intellij.inspectionlens.editor.LensSeverity | ||||
| import com.intellij.lang.annotation.HighlightSeverity | ||||
| import com.intellij.openapi.diagnostic.logger | ||||
| import com.intellij.profile.codeInspection.InspectionProfileManager | ||||
| import com.intellij.spellchecker.SpellCheckerSeveritiesProvider | ||||
|  | ||||
| object SpellCheckerSupport { | ||||
| 	private val log = logger<SpellCheckerSupport>() | ||||
| 	 | ||||
| 	fun load() { | ||||
| 		typoSeverity?.let { LensSeverity.registerMapping(it, LensSeverity.TYPO) } | ||||
| 	} | ||||
| 	 | ||||
| 	private val typoSeverity: HighlightSeverity? | ||||
| 		get() = try { | ||||
| 			SpellCheckerSeveritiesProvider.TYPO | ||||
| 		} catch (e: NoClassDefFoundError) { | ||||
| 			log.warn("Falling back to registered severity search due to ${e.javaClass.simpleName}: ${e.message}") | ||||
| 			InspectionProfileManager.getInstance().severityRegistrar.getSeverity("TYPO") | ||||
| 		} | ||||
| } | ||||
| @@ -39,13 +39,11 @@ class LensRenderer(info: HighlightInfo) : HintRenderer(null) { | ||||
| 	 | ||||
| 	private companion object { | ||||
| 		private fun getValidDescriptionText(text: String?): String { | ||||
| 			return if (text.isNullOrBlank()) " " else addMissingPeriod(convertHtmlToText(text)) | ||||
| 			return if (text.isNullOrBlank()) " " else addMissingPeriod(unescapeHtmlEntities(text)) | ||||
| 		} | ||||
| 		 | ||||
| 		private fun convertHtmlToText(potentialHtml: String): String { | ||||
| 			return potentialHtml | ||||
| 				.ifContains('<') { StringUtil.stripHtml(it, " ") } | ||||
| 				.ifContains('&', StringUtil::unescapeXmlEntities) | ||||
| 		private fun unescapeHtmlEntities(potentialHtml: String): String { | ||||
| 			return potentialHtml.ifContains('&', StringUtil::unescapeXmlEntities) | ||||
| 		} | ||||
| 		 | ||||
| 		private fun addMissingPeriod(text: String): String { | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| package com.chylex.intellij.inspectionlens.editor | ||||
|  | ||||
| import com.chylex.intellij.inspectionlens.InspectionLensRefresher | ||||
| import com.chylex.intellij.inspectionlens.compatibility.SpellCheckerSupport | ||||
| import com.intellij.lang.annotation.HighlightSeverity | ||||
| import com.intellij.spellchecker.SpellCheckerSeveritiesProvider | ||||
| import com.intellij.ui.ColorUtil | ||||
| import com.intellij.ui.ColorUtil.toAlpha | ||||
| import com.intellij.ui.JBColor | ||||
| @@ -43,9 +43,12 @@ enum class LensSeverity(baseColor: Color, lightThemeDarkening: Int, darkThemeBri | ||||
| 			HighlightSeverity.WARNING                         to WARNING, | ||||
| 			HighlightSeverity.WEAK_WARNING                    to WEAK_WARNING, | ||||
| 			HighlightSeverity.GENERIC_SERVER_ERROR_OR_WARNING to SERVER_PROBLEM, | ||||
| 			SpellCheckerSeveritiesProvider.TYPO               to TYPO, | ||||
| 		)) | ||||
| 		 | ||||
| 		init { | ||||
| 			SpellCheckerSupport.load() | ||||
| 		} | ||||
| 		 | ||||
| 		/** | ||||
| 		 * Registers a mapping from a [HighlightSeverity] to a [LensSeverity], and refreshes all open editors. | ||||
| 		 */ | ||||
|   | ||||
| @@ -17,6 +17,11 @@ | ||||
|   ]]></description> | ||||
|    | ||||
|   <change-notes><![CDATA[ | ||||
|     <b>Version 1.3.3</b> | ||||
|     <ul> | ||||
|       <li>Partially reverted fix for inspections that include HTML in their description due to breaking inspections with angled brackets.</li> | ||||
|       <li>Fixed plugin not working when installed on JetBrains Gateway Client.</li> | ||||
|     </ul> | ||||
|     <b>Version 1.3.2</b> | ||||
|     <ul> | ||||
|       <li>Fixed inspections randomly not disappearing.</li> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user