Skip to content
Open
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
3 changes: 1 addition & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ let package = Package(
name: "SwiftyMonaco",
dependencies: [],
resources: [
.copy("Resources"),
.copy("Highlighting/Languages")
.process("Resources"), // Fails code signing with .copy for some reason.
]),
.testTarget(
name: "SwiftyMonacoTests",
Expand Down
7 changes: 4 additions & 3 deletions Sources/SwiftyMonaco/Highlighting/SyntaxHighlight.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public struct SyntaxHighlight {
}

public extension SyntaxHighlight {
static let swift = SyntaxHighlight(title: "Swift", fileURL: Bundle.module.url(forResource: "swift", withExtension: "js", subdirectory: "Languages")!)
static let cpp = SyntaxHighlight(title: "C++", fileURL: Bundle.module.url(forResource: "cpp", withExtension: "js", subdirectory: "Languages")!)
static let systemVerilog = SyntaxHighlight(title: "SystemVerilog/Verilog", fileURL: Bundle.module.url(forResource: "systemVerilog", withExtension: "js", subdirectory: "Languages")!)
static let swift = SyntaxHighlight(title: "Swift", fileURL: Bundle.module.url(forResource: "swift", withExtension: "js")!) //, subdirectory: "Languages")!)
static let cpp = SyntaxHighlight(title: "C++", fileURL: Bundle.module.url(forResource: "cpp", withExtension: "js")!) //, subdirectory: "Languages")!)
static let javascript = SyntaxHighlight(title: "JavaScript", fileURL: Bundle.module.url(forResource: "javascript", withExtension: "js")!) //, subdirectory: "Languages")!)
static let systemVerilog = SyntaxHighlight(title: "SystemVerilog/Verilog", fileURL: Bundle.module.url(forResource: "systemVerilog", withExtension: "js")!) //, subdirectory: "Languages")!)
}
8 changes: 7 additions & 1 deletion Sources/SwiftyMonaco/MonacoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public class MonacoViewController: ViewController, WKUIDelegate, WKNavigationDel
}

private func loadMonaco() {
let myURL = Bundle.module.url(forResource: "index", withExtension: "html", subdirectory: "Resources")
// let myURL = Bundle.module.url(forResource: "index", withExtension: "html", subdirectory: "Resources")
let myURL = Bundle.module.url(forResource: "index", withExtension: "html")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
}
Expand Down Expand Up @@ -110,6 +111,10 @@ public class MonacoViewController: ViewController, WKUIDelegate, WKNavigationDel
let _scrollbar = self.delegate?.monacoView(getScrollbar: self)
let scrollbar = "scrollbar: { vertical: \(_scrollbar ?? true ? "\"visible\"" : "\"hidden\"") }"

// WordWrap
let _wordWrap = self.delegate?.monacoView(getWordWrap: self)
let wordWrap = "wordWrap: \(_wordWrap ?? false)"

// Smooth Cursor
let _smoothCursor = self.delegate?.monacoView(getSmoothCursor: self)
let smoothCursor = "cursorSmoothCaretAnimation: \(_smoothCursor ?? false)"
Expand Down Expand Up @@ -195,6 +200,7 @@ public protocol MonacoViewControllerDelegate {
func monacoView(getSyntax controller: MonacoViewController) -> SyntaxHighlight?
func monacoView(getMinimap controller: MonacoViewController) -> Bool
func monacoView(getScrollbar controller: MonacoViewController) -> Bool
func monacoView(getWordWrap controller: MonacoViewController) -> Bool
func monacoView(getSmoothCursor controller: MonacoViewController) -> Bool
func monacoView(getCursorBlink controller: MonacoViewController) -> CursorBlink
func monacoView(getFontSize controller: MonacoViewController) -> Int
Expand Down
1 change: 0 additions & 1 deletion Sources/SwiftyMonaco/Resources/0.app.js.map

This file was deleted.

Loading