#151 [File View] highlight sourcecode syntax

Closed
opened 1 month ago by 6543 · 10 comments
6543 commented 1 month ago

If noticed a language - highlite it

If noticed a language - highlite it
6543 self-assigned this 1 month ago
6543 added the
Improvement
label 1 month ago
6543 added the
UI/UX
label 1 month ago
mmarif commented 1 month ago
Owner

I was about to open an issue with the same title. :)

I was thinking, we should look for a library if possible which do many things like languages highlights, render repo images etc. If we can do it without a library would be awesome, but not easy of a task though.

I was about to open an issue with the same title. :) I was thinking, we should look for a library if possible which do many things like languages highlights, render repo images etc. If we can do it without a library would be awesome, but not easy of a task though.
6543 commented 1 month ago
Poster

@mmarif psoido code idear:

type = File_Detect_Type(file)
 -> https://sourceforge.net/projects/mime-util/ ?
Switch(type){
 case "txt":
   Syntax highlight
     -> https://github.com/bobbylight/RSyntaxTextArea ?
   break;
 case "pic":
   PicViewer();
   break;
 default:
   Binary_Icon.setText("file type (" + type + ") cant be displayed");
   break;
}
@mmarif psoido code idear: ```java type = File_Detect_Type(file) -> https://sourceforge.net/projects/mime-util/ ? Switch(type){ case "txt": Syntax highlight -> https://github.com/bobbylight/RSyntaxTextArea ? break; case "pic": PicViewer(); break; default: Binary_Icon.setText("file type (" + type + ") cant be displayed"); break; } ```
mmarif commented 1 month ago
Owner

Yes, but doing it for almost all languages we know would not be easy. We can use a library.

Yes, but doing it for almost all languages we know would not be easy. We can use a library.
6543 commented 1 month ago
Poster

-> https://sourceforge.net/projects/mime-util/ ? -> https://github.com/bobbylight/RSyntaxTextArea ?

I found them in a quic search … do you know them?

-> https://sourceforge.net/projects/mime-util/ ? -> https://github.com/bobbylight/RSyntaxTextArea ? I found them in a quic search ... do you know them?
mmarif commented 1 month ago
Owner

Nope, but I found this interesting library.

https://github.com/kbiakov/CodeView-Android

Nope, but I found this interesting library. https://github.com/kbiakov/CodeView-Android
6543 commented 2 weeks ago
Poster

I i try to build GitNex with this lib:

Duplicate class org.intellij.lang.annotations.Flow found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Language found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.MagicConstant found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Pattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.PrintFormat found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.RegExp found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.intellij.lang.annotations.Subst found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.Contract found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.Nls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.NonNls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.NotNull found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.Nullable found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.PropertyKey found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)
Duplicate class org.jetbrains.annotations.TestOnly found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0)

Go to the documentation to learn how to Fix dependency resolution errors.
I i try to build GitNex with this lib: ``` Duplicate class org.intellij.lang.annotations.Flow found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.Language found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.MagicConstant found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.Pattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.PrintFormat found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.RegExp found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.intellij.lang.annotations.Subst found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.Contract found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.Nls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.NonNls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.NotNull found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.Nullable found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.PropertyKey found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Duplicate class org.jetbrains.annotations.TestOnly found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-17.0.0.jar (org.jetbrains:annotations-java5:17.0.0) Go to the documentation to learn how to Fix dependency resolution errors. ```
6543 commented 2 weeks ago
Poster

@mmarif I forked it to https://github.com/6543-forks/CodeView-Android so if you have a idear …

@mmarif I forked it to https://github.com/6543-forks/CodeView-Android so if you have a idear ...
mmarif commented 2 weeks ago
Owner

Ok @6543 , I will take a look.

Ok @6543 , I will take a look.
mmarif commented 2 weeks ago
Owner

Add this before dependencies block in app build.gradle.

configurations {
    cleanedAnnotations
    compile.exclude group: 'org.jetbrains' , module:'annotations'
}
Add this before dependencies block in app build.gradle. ``` configurations { cleanedAnnotations compile.exclude group: 'org.jetbrains' , module:'annotations' } ```
mmarif added this to the 2.3.0 milestone 1 week ago
mmarif commented 1 week ago
Owner

Close via #187

Close via #187
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.